workflow retry logic

This commit is contained in:
Daniel A. Wozniak 2025-02-02 14:28:29 -07:00 committed by Daniel Wozniak
parent 7c95b78604
commit 5aa82db68a
7 changed files with 85 additions and 0 deletions

View file

@ -2246,3 +2246,14 @@ jobs:
if: always()
run:
echo "All worflows finished"
retry-if-needed:
needs:
- set-pipeline-exit-status
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-24.04
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}

View file

@ -3168,3 +3168,14 @@ jobs:
if: always()
run:
echo "All worflows finished"
retry-if-needed:
needs:
- set-pipeline-exit-status
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-24.04
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}

View file

@ -485,3 +485,14 @@ jobs:
if: always()
run:
echo "All worflows finished"
retry-if-needed:
needs:
- set-pipeline-exit-status
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-24.04
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}

19
.github/workflows/retry-workflow.yml vendored Normal file
View file

@ -0,0 +1,19 @@
name: Retry workflow
on:
workflow_dispatch:
inputs:
run_id:
required: true
jobs:
rerun:
runs-on: ubuntu-latest
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed

View file

@ -2295,3 +2295,14 @@ jobs:
if: always()
run:
echo "All worflows finished"
retry-if-needed:
needs:
- set-pipeline-exit-status
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-24.04
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}

View file

@ -3076,3 +3076,14 @@ jobs:
if: always()
run:
echo "All worflows finished"
retry-if-needed:
needs:
- set-pipeline-exit-status
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-24.04
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}

View file

@ -376,3 +376,14 @@ jobs:
if: always()
run:
echo "All worflows finished"
retry-if-needed:
needs:
- set-pipeline-exit-status
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-24.04
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}