A run cancelled by a concurrency group loses the work it had already finished. An hourly sweep now walks every branch, and when its latest run ended cancelled it restarts only the failed jobs through gh run rerun --failed, keeping the successful ones. CI_RERUN_INTERVAL_MINUTES, CI_RERUN_MAX_ATTEMPTS and CI_RERUN_MAX_AGE_HOURS tune the sweep. A cron expression cannot read a repository variable, so the workflow is triggered every full hour and a gate lets only the hours through that open the configured window; the gate reads the hour, not the minute, so a late start still counts for its hour. An unset attempt ceiling means no ceiling, bounded only by the 50 reruns GitHub allows per run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Run Reruns 🔁
Shell helpers that restart the unfinished parts of GitHub Actions workflow runs that were cancelled rather than completed.
Scope 📋
This directory contains helpers invoked from scheduled workflows. They call the GitHub Actions API to rerun the failed jobs of a cancelled run, never the run as a whole, so the work that already succeeded is kept. A run is a candidate only while it is recent and below its attempt ceiling; both bounds are passed in by the calling workflow, because a sweep without them would resurrect abandoned branches and retry a permanently cancelled run forever.
Helpers MUST NOT rerun a run whose conclusion is failure. A real defect has to be fixed, not retried, and the cancel helpers exist precisely so that a cancellation means "interrupted", not "broken".
For the workflow catalog that drives these calls see workflows.md.