Skip to content

feat: re-run failed jobs lost to a runner, a bounded number of times - #15

Merged
Mearman merged 3 commits into
mainfrom
feat/rerun-lost-runners
Nov 17, 2026
Merged

Mearman merged 3 commits into
mainfrom
feat/rerun-lost-runners

Conversation

@Mearman

@Mearman Mearman commented Nov 17, 2026

Copy link
Copy Markdown
Member

Adds an opt-in rerun-lost-runners input, the number of re-runs allowed for a workflow run whose failed jobs were all lost to their runner. The default of 0 changes nothing.

For a workflow_run that did not succeed, merge.sh reads the annotations of each failed or cancelled job and calls rerun-failed-jobs only when every one carries a runner-loss annotation. A test or build failure, or a job cancelled by its own timeout, leaves the run alone, as does a run whose attempt number is past the limit. Each job is written to the step summary as re-run or left alone, with the reason. A successful run is merged as before. The re-run uses read-token, which needs actions: write; the README says so.

Not tested against a real runner loss, only against the stubbed gh the suite uses.

Refs #14

A pull request whose required check failed because a self-hosted runner
was lost is never merged, and stays that way until someone re-runs the
failed jobs by hand.

The opt-in rerun-lost-runners input is the number of re-runs allowed.
For a workflow run that did not succeed, the annotations of each failed
or cancelled job are read, and the failed jobs are re-run only when
every one carries a runner-loss annotation. A test or build failure, or
a job cancelled by its own timeout, leaves the run alone. A run whose
attempt number is past the limit is never re-run again. Each job is
written to the step summary as re-run or left alone, with the reason.

The default of 0 changes nothing.

Refs #14
The classification now keys on the prefixes of the messages GitHub
writes for a runner that lost contact and for a job past its time
limit, replacing wording that had been assumed. The tests use those
messages, including one cut short as a captured annotation was.
Jobs were picked by a failure or cancelled conclusion before their
annotations were read, so a job lost to its runner under any other
conclusion was missed. Every job whose conclusion is not success,
skipped or neutral is now read, and a job still running is left alone.
A job that timed out with no runner-loss annotation counts as a
timeout.
@Mearman
Mearman marked this pull request as ready for review November 17, 2026 08:48
@Mearman
Mearman merged commit e35ee26 into main Nov 17, 2026
10 checks passed
@Mearman
Mearman deleted the feat/rerun-lost-runners branch November 17, 2026 08:49
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant