diff --git a/.github/workflows/github-no-web-commits.yml b/.github/workflows/github-no-web-commits.yml index 77ba1f31b91..e64ec74b566 100644 --- a/.github/workflows/github-no-web-commits.yml +++ b/.github/workflows/github-no-web-commits.yml @@ -21,23 +21,18 @@ 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]') { + if (prAuthor === 'renovate[bot]' || response.status === 200) { 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);