Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/rerun_timedout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Rerun Timed Out Workflow"

on:
workflow_run:
workflows: ["Unit tests", "Updater test"]
types:
- completed

jobs:
rerun_if_timed_out:
runs-on: ubuntu-latest
# Only run if the workflow concluded with "timed_out" and it's the first attempt.
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.run_attempt == 1 }}
steps:
- name: Rerun workflow due to timeout
uses: actions/github-script@v6
with:
script: |
const runId = context.payload.workflow_run.id;
console.log(`Workflow run ${runId} timed out. Triggering rerun...`);
await github.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun', {
owner: context.repo.owner,
repo: context.repo.repo,
run_id: runId
});
Loading