From e9df4ff2c9f7f4ee78984518784d8d519be96b72 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Sun, 12 Nov 2023 11:52:13 +0530 Subject: [PATCH] fix(actions): syntax error in script --- .github/workflows/github-no-web-commits.yml | 25 ++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/github-no-web-commits.yml b/.github/workflows/github-no-web-commits.yml index e64ec74b566..4bfc1866474 100644 --- a/.github/workflows/github-no-web-commits.yml +++ b/.github/workflows/github-no-web-commits.yml @@ -21,18 +21,23 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const prAuthor = context.payload.pull_request.user.login; - const response = await github.rest.teams - .getMembershipForUserInOrg({ - org: context.repo.owner, - team_slug: team, - username: prAuthor - }) - .catch(() => { - status: 404; - }); let isAllowListed = false; - if (prAuthor === 'renovate[bot]' || response.status === 200) { + if (prAuthor === 'renovate[bot]') { isAllowListed = true; + } else { + const teams = ['ops', 'bots', 'staff', 'dev-team', 'moderators']; + for (const team of teams) { + const response = await github.rest.teams.getMembershipForUserInOrg({ + org: context.repo.owner, + team_slug: team, + username: prAuthor + }); + }).catch(() => ({status: 404})); + if (response.status == 200) { + isAllowListed = true; + break; + } + } } core.setOutput('is_allow_listed', isAllowListed);