File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ # Workflow runs on main, on a release branch, and that were triggered as part of a merge group have
2+ # already passed CI before being merged. Therefore if they fail, we should make sure that there
3+ # wasn't a transient failure by rerunning the failed jobs once before investigating further.
4+ name : Deflake
5+
6+ on :
7+ workflow_run :
8+ types : [completed]
9+
10+ jobs :
11+ rerun-on-failure :
12+ name : Rerun failed workflows
13+ if : >-
14+ github.event.workflow_run.conclusion == 'failure' &&
15+ github.event.workflow_run.run_attempt == 1 &&
16+ (
17+ github.event.workflow_run.head_branch == 'main' ||
18+ startsWith(github.event.workflow_run.head_branch, 'releases/') ||
19+ github.event.workflow_run.event == 'merge_group'
20+ )
21+ runs-on : ubuntu-slim
22+ permissions :
23+ actions : write
24+ steps :
25+ - name : Rerun failed jobs in ${{ github.event.workflow_run.name }}
26+ env :
27+ GH_TOKEN : ${{ github.token }}
28+ GH_REPO : ${{ github.repository }}
29+ RUN_ID : ${{ github.event.workflow_run.id }}
30+ RUN_NAME : ${{ github.event.workflow_run.name }}
31+ RUN_URL : ${{ github.event.workflow_run.html_url }}
32+ run : |
33+ echo "Rerunning failed jobs for workflow run ${RUN_ID}"
34+ gh run rerun "${RUN_ID}" --failed
35+ echo "### Reran failed jobs :recycle:" >> "$GITHUB_STEP_SUMMARY"
36+ echo "" >> "$GITHUB_STEP_SUMMARY"
37+ echo "Workflow: [${RUN_NAME}](${RUN_URL})" >> "$GITHUB_STEP_SUMMARY"
You can’t perform that action at this time.
0 commit comments