Skip to content

Auto Retry Failed Jobs #10

Auto Retry Failed Jobs

Auto Retry Failed Jobs #10

Workflow file for this run

name: Auto Retry Failed Jobs
# This is to handle the case where the oc-login setup action fails due to intermittent network blocks (reputation issues on the IP).
#The workflow will re-run the failed jobs up to 3 times.
on:
workflow_run:
workflows:
- "1. Build & Deploy to Dev"
- "2. Create Tag & Build/Deploy to Test"
- "3. Create Tag & Build/Deploy to UAT"
types: [completed]
jobs:
retry-failed-job:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt < 3 }}
permissions:
actions: write
steps:
- name: Re-run failed jobs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
gh run rerun "$RUN_ID" --failed