-
Notifications
You must be signed in to change notification settings - Fork 12
105 lines (103 loc) · 3.69 KB
/
statuscheck-runner.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Status Check Runner
on:
issue_comment:
types:
- created
jobs:
checkif:
runs-on: ubuntu-latest
name: Check Comment Content
outputs:
shouldc: ${{ steps.checkc.outputs.shouldc }}
shouldtun: ${{ steps.checkc.outputs.shouldtun }}
shouldtui: ${{ steps.checkc.outputs.shouldtui }}
steps:
- name: Check
id: checkc
run: |
if [[ "${{ github.event.comment.body }}" != *"!Run check"* ]]; then
echo "The comment content does not contain the specified text. Cancelling workflow."
echo "::set-output name=shouldc::false"
else
echo "The comment content contains the specified text. Continuing with further actions."
echo "::set-output name=shouldc::true"
fi
if [[ "${{ github.event.comment.body }}" != *"!Export IPA"* ]]; then
echo "::set-output name=shouldtun::false"
else
echo "::set-output name=shouldtun::true"
fi
if [[ "${{ github.event.comment.body }}" != *"!Deploy TF"* ]]; then
echo "::set-output name=shouldtui::false"
else
echo "::set-output name=shouldtui::true"
fi
get-head-sha:
name: Get Pull Request Head SHA
needs: checkif
runs-on: ubuntu-latest
outputs:
psha: ${{ steps.getsha.outputs.psha }}
repository: ${{ steps.getsha.outputs.repository }}
lsha: ${{ steps.getsha.outputs.lsha }}
env:
slink: ${{ github.event.issue.pull_request.url }}
steps:
- name: Get SHA
id: getsha
run: |
json_data=$(curl -s "$slink")
sha=$(echo "$json_data" | jq -r '.head.ref')
repo=$(echo "$json_data" | jq -r '.head.repo.full_name')
lsha=$(echo "$json_data" | jq -r '.head.sha')
echo "psha=$sha" >> $GITHUB_OUTPUT
echo "repository=$repo" >> $GITHUB_OUTPUT
echo "lsha=$lsha" >> $GITHUB_OUTPUT
call-check-workflow:
name: Call Check Overflow
needs:
- get-head-sha
- checkif
if: ${{ needs.checkif.outputs.shouldc == 'true' }}
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Call
uses: benc-uk/[email protected]
with:
workflow: status-check.yml
ref: ${{ needs.get-head-sha.outputs.psha }}
inputs: '{ "psha": "${{ needs.get-head-sha.outputs.psha }}", "repository": "${{ needs.get-head-sha.outputs.repository }}", "lsha": "${{ needs.get-head-sha.outputs.lsha }}" }'
call-company-export-workflow:
name: Call Company Export Overflow
needs:
- get-head-sha
- checkif
if: ${{ needs.checkif.outputs.shouldtun == 'true' }}
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Call
uses: benc-uk/[email protected]
with:
workflow: company-export.yml
ref: ${{ needs.get-head-sha.outputs.psha }}
inputs: '{ "psha": "${{ needs.get-head-sha.outputs.psha }}", "repository": "${{ needs.get-head-sha.outputs.repository }}", "lsha": "${{ needs.get-head-sha.outputs.lsha }}" }'
call-tf-deploy-workflow:
name: Call TestFlight Internal Deploy Overflow
needs:
- get-head-sha
- checkif
if: ${{ needs.checkif.outputs.shouldtui == 'true' }}
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Call
uses: benc-uk/[email protected]
with:
workflow: tf.yml
ref: ${{ needs.get-head-sha.outputs.psha }}
inputs: '{ "psha": "${{ needs.get-head-sha.outputs.psha }}", "repository": "${{ needs.get-head-sha.outputs.repository }}", "lsha": "${{ needs.get-head-sha.outputs.lsha }}" }'