diff --git a/.github/workflows/trigger_all_tests.yml b/.github/workflows/trigger_all_tests.yml index f158e434fb..37d6c95b3b 100644 --- a/.github/workflows/trigger_all_tests.yml +++ b/.github/workflows/trigger_all_tests.yml @@ -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