From d6156c97a77d4a4c78d43abea6d6e2095176eaa2 Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Tue, 12 Sep 2023 20:57:30 +0100 Subject: [PATCH] Try custom script --- .github/workflows/check_author.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_author.yml b/.github/workflows/check_author.yml index ccb212b7f..840292560 100644 --- a/.github/workflows/check_author.yml +++ b/.github/workflows/check_author.yml @@ -8,5 +8,15 @@ jobs: name: Check author runs-on: ubuntu-20.04 steps: - - name: Check email - run: echo "This PR is opened by ${{ github.event.pull_request.user.email }}." + - uses: actions/github-script@v6 + with: + script: | + // If user is member of my_team team do nothing else do something + // See: https://octokit.github.io/rest.js/v18#teams + const creator = context.payload.sender.login + const result = await github.rest.teams.getMembershipForUserInOrg({ + org: context.repo.owner, + team_slug: 'my-cool-team', + username: creator + }) + console.log(creator, result) // do whatever you want