gha-doctor

v0.66.0
io.github.linnea-bakshi/gha-doctor Checked 4 days ago Published 2 months ago

Diagnose GitHub Actions CI: lint, flaky tests, wasted minutes, health score.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

analyze_repo

Full CI health report for a GitHub repository: static workflow lint, run-history analysis (success/failure rates, flaky jobs, retry waste, superseded PR runs, queue times, duration trends, zombie crons, PR feedback time), cache and artifact checkups, a 0-100 health score, and a ranked, dollar-quantified top-wins list. Makes ~100+ GitHub API calls and typically takes 10-30 seconds. Optionally set flaky_logs to also read N flaky-failure job logs and name the flaky tests (needs a token), or cache_logs to measure the real cache hit rate from N job logs.

ParameterTypeDescription
repo *stringRepository as owner/name, e.g. cli/cli
cache_logsintegerSample N job logs to measure the real cache hit/miss rate (1 API request per log; needs a token)
flaky_logsintegerRead N flaky-failure job logs to name the flaky tests (1 API request per log; needs a token)
runsintegerNumber of recent runs to sample (default 100)
workflowstringScope the history analysis to one workflow (file name like ci.yml, or display name); no health score in scoped mode

lint_repo

Static lint of GitHub Actions workflows and action manifests only (no run history, fast): 21 rules covering missing timeouts, no concurrency cancellation, dead action versions, retired runner labels, deprecated workflow commands, unguarded crons, and more. Pass repo to lint any GitHub repository via the API (no clone needed), or dir for a local checkout (offline). Defaults to the current directory.

ParameterTypeDescription
dirstringLocal repository directory to lint (default ".")
repostringRepository as owner/name to lint remotely (mutually exclusive with dir)

preview_fixes

Preview the exact unified diff that gha-doctor --fix would apply for auto-fixable findings (10 of 21 rules), without writing anything. Pass repo for any GitHub repository (no clone needed) or dir for a local checkout. To actually apply fixes, run `gha-doctor --fix` in the repository — this MCP server never writes.

ParameterTypeDescription
dirstringLocal repository directory (default ".")
repostringRepository as owner/name (mutually exclusive with dir)

run_deep_dive

Deep-dive one workflow run: why was it slow, or why did it fail? Job waterfall (queue vs execution), every job and step compared against the workflow's own recent medians, named step regressions; failed runs lead with the failing job and step, name the failing tests (30+ test frameworks recognized), and inline the failing step's log tail (needs a token).

ParameterTypeDescription
repo *stringRepository as owner/name
log_tailintegerLines of the failing step's log to include per failed job (default 20, 0 = off; needs a token)
runstringRun ID, full run URL, or "latest" (default "latest")

pr_deep_dive

Diagnose a pull request's CI: every workflow run on the PR's head commit, how long the PR waited for a verdict, re-run smells, and a full deep dive into the latest failed run — failing job and step, named failing tests (30+ frameworks recognized), and the failing step's log tail. The natural first call when someone asks why CI is failing or slow on their PR.

ParameterTypeDescription
pr *integerPull request number
repo *stringRepository as owner/name
log_tailintegerLines of the failing step's log to include per failed job (default 20, 0 = off; needs a token)

org_overview

Fleet triage across an organization's (or user's) most recently pushed repositories: per-repo run counts, failure rates, median duration, compute minutes, last-run age, and fleet-wide zombie crons (scheduled workflows failing on repeat), one API call per repo. Useful for finding which repository's CI to look at first.

ParameterTypeDescription
org *stringGitHub organization or user login
max_reposintegerMax repositories to scan, most recently pushed first (default 20)

explain_rule

Print the full documentation for one lint rule: what it flags, why it matters, how to fix it, and how to suppress it. Rule IDs look like D001; every finding cites one.

ParameterTypeDescription
rule *stringRule ID, e.g. D001