Skip to content

Commit

Permalink
admin check
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-sorrentino committed Aug 31, 2024
1 parent 1cd659a commit a309dee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bypass-css-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
AUTHOR=$(gh pr view ${{ github.event.pull_request.number }} --json author --jq '.author.login')
ADMIN_CHECK=$(gh api orgs/${{ github.repository_owner }}/members/$AUTHOR --jq '.role')
ADMIN_CHECK=$(gh api user/memberships/orgs/scidsg --jq '.role')
if [ "$ADMIN_CHECK" != "admin" ]; then
echo "User is not an admin. Exiting."
echo "User is not an admin or is not a public member of the organization. Exiting."
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bypass-version-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
AUTHOR=$(gh pr view ${{ github.event.pull_request.number }} --json author --jq '.author.login')
ADMIN_CHECK=$(gh api orgs/${{ github.repository_owner }}/members/$AUTHOR --jq '.role')
ADMIN_CHECK=$(gh api user/memberships/orgs/scidsg --jq '.role')
if [ "$ADMIN_CHECK" != "admin" ]; then
echo "User is not an admin. Exiting."
echo "User is not an admin or is not a public member of the organization. Exiting."
exit 1
fi
Expand Down

0 comments on commit a309dee

Please sign in to comment.