How to export GitHub Actions run history and find what breaks your pipelines
GitHub keeps a record of every workflow run. A few hundred rows of that history, exported to CSV, are enough to see which workflows fail most and how many minutes the failures cost.
Option A: the GitHub CLI
gh run list lists recent runs; -L / --limit sets how many, and the default is 20. With --json you choose fields, including workflowName, conclusion, status, startedAt, updatedAt, event and headBranch. This command writes a CSV with the four columns the free report expects:
gh run list -L 200 --json workflowName,conclusion,startedAt,updatedAt | jq -r '["workflow","status","duration_minutes","failure_reason"], (.[] | [.workflowName, .conclusion, (((.updatedAt|fromdate) - (.startedAt|fromdate)) / 6 | round / 10), ""]) | @csv' > runs.csv
The duration is approximate: the time from start to the run's last update.
Option B: the REST API
GET /repos/{owner}/{repo}/actions/runs lists runs for a repository. GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs lists runs for one workflow, and accepts the workflow file name. Both return up to 100 per page.
Useful filters are status (which also accepts conclusions such as failure and timed_out), branch, event and created.
Each run includes name, status, conclusion, run_started_at and updated_at. GitHub notes that results are capped at 1,000 per search when you use certain filters.
GitHub has announced that the per-run usage endpoint (/actions/runs/{run_id}/timing) is closing down, so base durations on timestamps instead.
Add a failure reason
The conclusion tells you a run failed, not why. Fill failure_reason with a short, consistent label, for example flaky test, dependency download, timeout or lint. Base it on the failed step or log. Consistent labels are what make the counts meaningful.
Read the report
Paste the CSV into the free CI failure report. It treats failed, failure and timed_out as failures, and shows:
- the top failure causes and each one's share of failures;
- the overall failure rate;
- minutes per workflow, including minutes spent on failed runs.
Strings that look like tokens or keys are redacted before analysis, and the file never leaves your browser.
Fix the top cause first; it accounts for the most reruns.
Try it free: Free CI failure report (CSV)
Paste your CI run history and get the top failure causes, failure rate, and minutes per workflow, including minutes spent on failed runs.
Open the free tool →About the product: Pipeline Insights
The tool runs in your browser: your data stays on your device. No signup.
Sources
Venture Lab 10 is independent. Other product and service names are used only to describe compatibility or for comparison, and are trademarks of their owners.