Skip to content

Commit a922d3e

Browse files
committed
Auto rerun on failed tests
1 parent be3c507 commit a922d3e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/workflows/elixir.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ jobs:
1111
uses: mtrudel/elixir-ci-actions/.github/workflows/test.yml@main
1212
lint:
1313
uses: mtrudel/elixir-ci-actions/.github/workflows/lint.yml@main
14+
re-run:
15+
needs: [test, lint]
16+
if: failure() && fromJSON(github.run_attempt) < 3
17+
runs-on: ubuntu-latest
18+
steps:
19+
- env:
20+
GH_REPO: ${{ github.repository }}
21+
GH_TOKEN: ${{ github.token }}
22+
GH_DEBUG: api
23+
run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}

.github/workflows/rerun.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
run_id:
5+
required: true
6+
jobs:
7+
rerun:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: rerun ${{ inputs.run_id }}
11+
env:
12+
GH_REPO: ${{ github.repository }}
13+
GH_TOKEN: ${{ github.token }}
14+
GH_DEBUG: api
15+
run: |
16+
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
17+
gh run rerun ${{ inputs.run_id }} --failed

0 commit comments

Comments
 (0)