Retry Failed Nightly Jobs #518
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: Retry Failed Nightly Jobs | |
| on: | |
| workflow_run: | |
| workflows: ["Nightly Examples", "Nightly Signal Execute"] | |
| types: [completed] | |
| permissions: | |
| actions: write | |
| jobs: | |
| retry: | |
| if: >- | |
| github.event.workflow_run.conclusion == 'failure' | |
| && github.event.workflow_run.run_attempt < 3 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Re-run failed jobs (attempt ${{ github.event.workflow_run.run_attempt }}/3) | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.actions.reRunWorkflowFailedJobs({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| run_id: ${{ github.event.workflow_run.id }}, | |
| }); |