@@ -17,14 +17,25 @@ jobs:
17
17
- name : Cancel previous runs
18
18
uses : styfle/cancel-workflow-action@0.9.1
19
19
20
+ - name : Checkout repo from main branch
21
+ uses : actions/checkout@v4
22
+
20
23
- name : Get branch of PR
21
- uses : xt0rted/pull-request-comment-branch@v1
24
+ uses : xt0rted/pull-request-comment-branch@v3
22
25
id : comment-branch
23
26
24
- - name : Checkout PR branch ${{ steps.comment-branch.outputs.head_ref }}
25
- uses : actions/checkout@v3
27
+ - name : Debug
28
+ run : |
29
+ echo "base_ref: ${{steps.comment-branch.outputs.base_ref}}"
30
+ echo "base_sha: ${{steps.comment-branch.outputs.base_sha}}"
31
+ echo "head_ref: ${{steps.comment-branch.outputs.head_ref}}"
32
+ echo "head_sha: ${{steps.comment-branch.outputs.head_sha}}"
33
+ echo "event.number: ${{github.event.number}}"
34
+
35
+ - name : Checkout PR branch - ${{ steps.comment-branch.outputs.head_ref }}
36
+ uses : r@v3
26
37
with :
27
- ref : ${{ steps.comment-branch.outputs.head_ref }}
38
+ ref : ${{ steps.comment-branch.outputs.head_sha }}
28
39
29
40
- name : Add workflow link as comment on PR
30
41
uses : actions/github-script@v6
33
44
script : |
34
45
const name = '${{ github.workflow }}';
35
46
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
36
- const body = `Run GH Workflow: ${name}`;
47
+ const body = `Run GH Workflow: ${name}\n${url} `;
37
48
38
49
await github.rest.issues.createComment({
39
50
issue_number: context.issue.number,
49
60
50
61
- name : Check Xcode version
51
62
run : /usr/bin/xcodebuild -version
52
-
53
- - name : Checkout repo from main branch
54
- uses : actions/checkout@v4
55
63
56
64
- name : Install Apple certificate and provisioning profile
57
65
env :
@@ -130,3 +138,21 @@ jobs:
130
138
- name : 4/4 - Build example (paper, dynamic frameworks)
131
139
run : yarn run build:ios
132
140
141
+ # Builds completed...
142
+
143
+ - name : Add workflow result as comment on PR
144
+ uses : actions/github-script@v6
145
+ if : always()
146
+ with :
147
+ script : |
148
+ const name = '${{ github.workflow }}';
149
+ const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
150
+ const success = '${{ job.status }}' === 'success';
151
+ const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`;
152
+
153
+ await github.rest.issues.createComment({
154
+ issue_number: context.issue.number,
155
+ owner: context.repo.owner,
156
+ repo: context.repo.repo,
157
+ body: body
158
+ })
0 commit comments