Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bypass-review.yaml #545

Merged
merged 3 commits into from
Sep 7, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/bypass-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +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')

# Output the result for debugging purposes
echo "Admin check response: $ADMIN_CHECK"
glenn-sorrentino marked this conversation as resolved.
Show resolved Hide resolved

if [ "$ADMIN_CHECK" != "admin" ]; then
echo "User is not an admin or is not a public member of the organization. Exiting."
exit 1
Expand Down
Loading