Skip to content

Commit bb3bc3e

Browse files
authored
Merge pull request #2634 from balancer/chore/retry-failed-gh-actions
chore: add GitHub Actions workflow to auto-retry failed runs
2 parents eeb0fd6 + fc4a312 commit bb3bc3e

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/retry.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: retry
2+
on:
3+
workflow_run:
4+
workflows: ['**']
5+
types:
6+
- completed
7+
branches:
8+
- main
9+
10+
jobs:
11+
retry:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt == 1 && github.event.workflow_run.name != 'retry' }}
14+
permissions:
15+
actions: write
16+
steps:
17+
- name: Retry failed workflow
18+
run: |
19+
echo "Retrying workflow: ${{ github.event.workflow_run.name }} (run ${{ github.event.workflow_run.id }})"
20+
gh run rerun "${{ github.event.workflow_run.id }}" --repo "${{ github.event.repository.full_name }}" --failed
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)