Skip to content

Commit

Permalink
Fix workflow permission check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tonidero committed Jul 19, 2024
1 parent 2bc647e commit 28cc004
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/trigger_all_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ jobs:
steps:
- name: Check membership in RevenueCat Org
env:
READ_ORG_GITHUB_TOKEN: ${{ secrets.READ_ORG_GITHUB_TOKEN }}
id: verify
# ensure that only RevenueCat members can trigger this
run: |
RESPONSE=$(curl https://api.github.com/orgs/RevenueCat/members/${{ github.event.comment.user.login }})
if [[ "$RESPONSE" == *"Not Found"* ]]; then
RESPONSE=$(curl -s -o /dev/null --head -w "%{http_code}" -H "Authorization: Bearer $READ_ORG_GITHUB_TOKEN" https://api.github.com/orgs/RevenueCat/members/${{ github.event.comment.user.login }})
if [[ "$RESPONSE" != "204" ]]; then
echo "User is not a member of the organization"
exit 1
fi
Expand Down

0 comments on commit 28cc004

Please sign in to comment.