Overview
Ask OpenSRE “how many PRs and branches have failing CI across my organizations?” and it scans every repository your token can see, in parallel, and answers with the exact list: which PRs, which branches, which checks. The scan is read-only. It never re-runs, retries, or fixes anything; hand a result to Fix GitHub CI for that.Prerequisites
- GitHub connected via the GitHub integration, or
GITHUB_TOKEN/GH_TOKENin the environment - Token scopes:
repo(private repositories and their checks) andread:org(to list organizations)
read:org still scans your own account and any owner you name explicitly.
What it scans
A check counts as failing when its conclusion is
FAILURE, TIMED_OUT, ACTION_REQUIRED, or STARTUP_FAILURE, or a commit status (Vercel, Aikido, and similar) is FAILURE or ERROR. Cancelled checks are listed separately and not counted; a cancelled run is usually superseded, not broken.
Stale branches are the reason include_all_branches is off by default. On a real organization almost every failing branch was either a years-old ref or a duplicate of a failing PR; the PR list is the signal.
Example turn
Result fields
Speed and rate limits
Repositories are read ten per GraphQL request, eight requests in flight at once. 150 repositories with 200 open PRs finish in about 7 seconds; with every branch head included, about 10 seconds.concurrency (1 to 16) tunes the fan-out.
A full scan spends a few hundred of GitHub’s 5000 hourly GraphQL points. When the budget is gone GitHub answers every request with a rate-limit error and the tool reports that once instead of listing 150 unreadable repositories. Wait for the hour to reset or pass owners to narrow the scan.
Gotchas
- A PR from a fork shows as a failing PR but never as a failing branch; the branch lives in the fork.
- A Vercel or Aikido “failure” is often a blocked preview deploy or a security gate rather than a broken build. The check name tells you which.
- Only the 100 most recently updated open PRs per repository are scanned. A repository past that cap gets a coverage notice.
- A misspelled or inaccessible owner in
ownersis reported incoverage_notices; the other owners are still scanned.