Skip to content

Auto-rerun failed jobs (once) #34375

Auto-rerun failed jobs (once)

Auto-rerun failed jobs (once) #34375

name: Auto-rerun failed jobs (once)
permissions:
actions: write # for rerunning failed jobs
on:
# Trigger when test workflows complete with failure on first attempt
workflow_run:
workflows:
- "Unit tests"
- "End-to-End Tests"
- "End-to-End Component Tests"
- "CLI Unit tests"
- "eFPS Test"
types: [completed]
jobs:
auto-retry:
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt == 1 }}
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- name: Rerun failed jobs only
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh run rerun ${{ github.event.workflow_run.id }} --failed