-
Notifications
You must be signed in to change notification settings - Fork 328
42 lines (37 loc) · 1.35 KB
/
trigger_all_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Trigger All Tests
on:
issue_comment:
types: [created]
jobs:
trigger-circleci:
runs-on: ubuntu-latest
if: |
github.event.issue.pull_request &&
github.event.comment.body == '@RCGitBot please test' &&
github.repository == 'RevenueCat/purchases-ios'
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. According to Github docs, only 204
# response codes correspond to members of the organization.
run: |
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
echo "User is a member of the organization"
- name: Trigger CircleCI workflow
id: trigger_circleci_workflow
if: success()
uses: CircleCI-Public/[email protected]
with:
GHA_Meta: "run-from-github-comments"
env:
CCI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }}