From e6091b4b07035906499b4aed83ecc7a1b2ccbd71 Mon Sep 17 00:00:00 2001 From: Andy Boedo Date: Wed, 17 Jul 2024 12:35:11 -0300 Subject: [PATCH 1/4] empty commit to test ci triggers --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c2ef5f5374..6c413ea016 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1397,7 +1397,6 @@ workflows: jobs: - release-train - daily-loadshedder-integration-tests: when: and: From e13913625da0be81435de119284e5f7aab4b4be0 Mon Sep 17 00:00:00 2001 From: Andy Boedo Date: Wed, 17 Jul 2024 13:23:11 -0300 Subject: [PATCH 2/4] fix metadata passed in --- .circleci/config.yml | 4 +++- .github/workflows/trigger_all_tests.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6c413ea016..f6bf15137f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1424,7 +1424,9 @@ workflows: - equal: - "run-manual-tests" - << pipeline.parameters.action >> - - equal: [ "run-from-github-comments", << pipeline.parameters.GHA_Event >>] + - equal: + - "run-from-github-comments" + - << pipeline.parameters.GHA_Meta >> jobs: - backend-integration-tests-SK1 - backend-integration-tests-SK2 diff --git a/.github/workflows/trigger_all_tests.yml b/.github/workflows/trigger_all_tests.yml index f158e434fb..89a9cf462f 100644 --- a/.github/workflows/trigger_all_tests.yml +++ b/.github/workflows/trigger_all_tests.yml @@ -29,6 +29,6 @@ jobs: uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.2.0 with: - GHA_Action: "run-from-github-comments" + GHA_Meta: "run-from-github-comments" env: CCI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }} From 101e62a8c3d914e6b09385fa485140a39d148e58 Mon Sep 17 00:00:00 2001 From: Toni Rico Date: Fri, 19 Jul 2024 09:13:19 +0200 Subject: [PATCH 3/4] Fix workflow permission check logic --- .github/workflows/trigger_all_tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trigger_all_tests.yml b/.github/workflows/trigger_all_tests.yml index 89a9cf462f..98aaf22dac 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 From 998cbfddd4e4b8c5bb104c812d7fc7985117fbbc Mon Sep 17 00:00:00 2001 From: Toni Rico Date: Fri, 19 Jul 2024 10:01:31 +0200 Subject: [PATCH 4/4] Add additional check for repo name --- .github/workflows/trigger_all_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trigger_all_tests.yml b/.github/workflows/trigger_all_tests.yml index 98aaf22dac..2c76babb2c 100644 --- a/.github/workflows/trigger_all_tests.yml +++ b/.github/workflows/trigger_all_tests.yml @@ -9,7 +9,8 @@ jobs: runs-on: ubuntu-latest if: | ${{ github.event.issue.pull_request }} && - github.event.comment.body == '@RCGitBot please test' + github.event.comment.body == '@RCGitBot please test' && + github.repository == 'RevenueCat/purchases-ios' steps: - name: Check membership in RevenueCat Org