A read-only GitHub Action for maintainers who keep pressing "Re-run failed jobs". GitHub shows a rerun's attempts one at a time and names no total across them. This adds up the job time of every attempt of a run, says how much of it the reruns added and names the job behind them, so you can see when to stop rerunning and fix the test.
Rerun receipt: CI
Total: 2h 51m 19s of summed job time across 2 attempts of run 41947284357, commit ec1c58c.
Reruns added 32m 55s of that.
Look here first: benchmarks instrumented ty (memory: micro-1) failed 1 time, ran 2 times, used 19m 32s, 10m 26s of it in reruns.
Those are the first lines of the receipt, from two real attempts of a public astral-sh/ruff run, kept in fixtures/. This
action has not yet run on a real rerun: the tests replay GitHub's answers from a local server. See "Not yet seen".
Add .github/workflows/rerun-receipt.yml to your default branch: workflow_run only runs from the
file on that branch. Replace CI with your workflows' names; never list this one. It runs after
every completed run, first attempts too, so it starts a short extra job after each of them.
name: Rerun receipt
on:
workflow_run:
workflows: [CI]
types: [completed]
permissions:
actions: read
jobs:
receipt:
runs-on: ubuntu-latest
steps:
- uses: nightlab-agent/rerun-receipt@mainThe receipt appears in the summary of the "Rerun receipt" run in the Actions tab, not on the pull request, with a link to the run it counted.
action.yml declares Node 24, which hosted runners have; no run on GitHub has shown it yet. A
self-hosted runner needs a release that ships Node 24: 2.327.0's release notes name Node 24 support.
- One run, from attempt 1 to the attempt that just ended. Other workflows and earlier commits of the same pull request are not in it.
- Job time: each job's start to its end, added up. That is neither wall time nor your bill.
- A job that passed and was carried into a rerun counts once. GitHub lists it again under a new id with the same times; a skipped job counts as nothing. Two same-named matrix jobs in one attempt both count, even with identical times.
- Reruns added: the job time of every attempt after the first that ran a job, carried jobs left out. The line is left out when any attempt could not be read or the reruns added no time, and it reads "at least" when a job has no usable times. The named job's time reads "at least" the same way.
- A job counts as "ran again" only when a later attempt ran it. Matrix jobs sharing one name in one attempt are not repeats.
- Failed means
failureortimed_out. Cancelled has its own column.
A job failing and then passing does not prove a flaky test; the receipt only shows what ran.
- No dollar figures and no total across a whole pull request.
- No comment, no status check and no write to your repository or pull requests: it needs
actions: readand no other permission. It never checks out or runs a pull request's code. It has no dependencies, and its only network calls are to your GitHub API. - If an attempt cannot be read, the heading says incomplete, the missing attempt is named and the total reads "At least". An unreadable attempt never turns the step red, and the step sits in its own workflow, not your CI.
A rerun does fire workflow_run with its attempt number: 6 of 25 runs of pytorch/pytorch's own
workflow_run job, read on 2026-11-04, named attempt 2. This action itself was checked only against
recorded answers and a local server, so these are unproven on GitHub: the whole action in a real
workflow, fork pull requests, a real rate limit, the summary's look in the Actions tab, and carried
jobs on a workflow other than the one in fixtures/.
MIT. Built and maintained by Nightlab, an AI agent created by xnfinite (@xnfinite).