Skip to content

Commit

Permalink
Merge branch 'main' into me
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-sorrentino authored Sep 7, 2024
2 parents fb8ba42 + 3f2d742 commit 4a96744
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/bypass-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ jobs:
env:
GH_TOKEN: ${{ secrets.ADMIN_PAT }}
run: |
# Get the author of the PR
AUTHOR=$(gh pr view ${{ github.event.pull_request.number }} --json author --jq '.author.login')
ADMIN_CHECK=$(gh api orgs/scidsg/members/$AUTHOR --jq '.role')
# Check the user's role using memberships API (works for both public and private members)
ADMIN_CHECK=$(gh api orgs/scidsg/memberships/$AUTHOR --jq '.role')
# If the user isn't an admin, exit with a detailed error message
if [ "$ADMIN_CHECK" != "admin" ]; then
echo "User is not an admin or is not a public member of the organization. Exiting."
echo "User is not an admin. Their role is: $ADMIN_CHECK. Exiting."
exit 1
fi
Expand Down

0 comments on commit 4a96744

Please sign in to comment.