Skip to content

Commit f320ec4

Browse files
committed
ci: add automatic rerun controller for flaky workflows
1 parent c0a2b93 commit f320ec4

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/rerun-ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Rerun CI"
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- "HugeGraph-Server CI"
7+
- "HugeGraph-Commons CI"
8+
- "HugeGraph-PD & Store & Hstore CI"
9+
- "Cluster Test CI"
10+
types:
11+
- completed
12+
13+
permissions:
14+
actions: write
15+
contents: read
16+
17+
jobs:
18+
rerun-failed-jobs:
19+
if: >-
20+
github.event.workflow_run.conclusion == 'failure' &&
21+
fromJSON(github.event.workflow_run.run_attempt) < 2
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Show rerun target
25+
run: |
26+
echo "Workflow: ${{ github.event.workflow_run.name }}"
27+
echo "Run ID: ${{ github.event.workflow_run.id }}"
28+
echo "Run attempt: ${{ github.event.workflow_run.run_attempt }}"
29+
echo "Conclusion: ${{ github.event.workflow_run.conclusion }}"
30+
31+
- name: Rerun failed jobs
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
GH_REPO: ${{ github.repository }}
35+
run: |
36+
gh run rerun ${{ github.event.workflow_run.id }} --failed

0 commit comments

Comments
 (0)