Commit 1c55e70 1 parent 0b2328f commit 1c55e70 Copy full SHA for 1c55e70
File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Retry Build
2
+ on :
3
+ workflow_run :
4
+ workflows : [Build]
5
+ types :
6
+ - completed
7
+ jobs :
8
+ on-success :
9
+ runs-on : ubuntu-latest
10
+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
11
+ steps :
12
+ - run : echo 'The triggering workflow passed. No action will be taken.'
13
+ on-failure :
14
+ runs-on : ubuntu-latest
15
+ if : ${{ github.event.workflow_run.conclusion == 'failure' }}
16
+ steps :
17
+ - run : |
18
+ echo 'The triggering workflow failed. Retrying once.'
19
+
20
+ # get run id and rerun
21
+ RUNID=$(gh api repos/$OWNER/$REPO/commits/$COMMIT_SHA/check-runs |
22
+ jq -r '.check_runs[] |
23
+ select(.name == "Build") |
24
+ .html_url |
25
+ capture("/runs/(?<number>[0-9]+)/job") |
26
+ .number' |
27
+ sed 's/"//g' |
28
+ head -n 1)
29
+
30
+ gh run rerun $RUNID --failed
You can’t perform that action at this time.
0 commit comments