Auto-rerun failed jobs (once) #34376
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |