I built gha-rerun-ledger for a narrow task: inspect the attempts behind recent completed GitHub Actions runs, then keep enough metadata to replay the report offline.
A workflow rerun can show successful jobs that carried over from an earlier attempt. Counting every row in every attempt would count that work more than once. The CLI walks attempts in order and assigns each job ID to its first observed attempt. If a later page returns that ID again, the report checks that the name, execution owner, conclusion, timestamps, labels, and steps agree. Conflicting records fail the report. A complete sequence of attempts and pages is required before the tool sums time.
The report separates viewed jobs from owned jobs, so a carried row stays visible without adding its elapsed interval twice. Every attempt receives a ledger row, including an empty attempt. Skipped jobs, missing or reversed intervals, inferred owners, and runs above the attempt cap appear in coverage counts or warnings.
Job time is the difference between the job start and completion timestamps. Parallel jobs add together. Step intervals are ranked separately and are not added to job time. A failed-before-pass row requires a failure, timed_out, or startup_failure attempt followed by a successful attempt of the same run. It measures observed job time worth investigating. It does not prove flaky tests, unnecessary work, money saved, or billed minutes.
A live scan uses GET requests through GitHub CLI and can save a schema version 1 JSON snapshot. The snapshot records the parent metadata before and after collection, attempt responses, page counts, and job metadata. --input validates and replays it without GitHub access. Snapshots retain run and job API responses, including commit and actor metadata. The CLI does not request log files or save authentication headers. Check the retained metadata before sharing it.
Try the labeled synthetic demo with:
npx --yes github:Arthur031221/gha-rerun-ledger --demo
The demo reports 163 seconds on the failed attempt and 102 seconds on the later success. Those values come from the checked-in fixture and are summed job intervals. They are not cost or savings estimates.
I found gha-doctor during the project research. Its README describes a broader Actions audit with same-commit retry analysis, slow-step history, and recommendations. gha-rerun-ledger keeps its focus on the attempt ledger and offline replay. The code is MIT licensed. Feedback on the coverage model and snapshot checks is welcome.

Top comments (0)