How to see failing CI builds and their GitHub issues in one place
Maksim Norkin (opens in a new tab)Product
· 7 min read
GitHub keeps failing runs and issues on separate pages. Here’s how to put each failing build beside the issue it belongs to: the links, the commands, and a sheet.
Failing runs, and what they lead to
Branch
Pull request
Issue
GitHub has no single page that lists your failing builds beside the issues they relate to. Failing runs sit in each repository’s Actions tab, issues in its Issues tab, and the only thing joining them is a chain: a run ran on a branch, the branch has a pull request, and the pull request names an issue. Where any link is missing, so is the connection. This guide follows that chain by hand: where each list is, what links a run to an issue, two commands that print them side by side, and a sheet for when you need it all in one place. GitHub Actions is the example; the sheet works for any CI service.
In the browser, a repository’s Actions tab lists its workflow runs, and the sidebar narrows them to one workflow. Open a failed run and its summary shows which job failed; its logs can be searched and downloaded. From a terminal, the GitHub CLI does the same, one repository at a time: gh run list --status failure lists the latest failed runs, --branch and --workflow narrow them, and --limit fetches more than the default. gh run view <run-id> --log-failed prints only the steps that failed, which is usually the error you want.
Issues are per repository too: the Issues tab, or gh issue list in a terminal. A run doesn’t know about issues and an issue doesn’t know about runs, so printing the two lists one after the other, which is what most answers to this question suggest, leaves the matching to you. The matching is the part that takes time, and it depends on the links below.
- 1ChecksThe failing run, by job
- 2A closing keywordInto the default branch
- 3DevelopmentOr link it by hand
A run records its branch and commit. From there it reaches an issue through a pull request, or through the branch itself, in one of three ways:
- A closing keyword. Writing
Fixes #17in the pull request’s description links issue 17 and closes it on merge. GitHub accepts close, closes, closed, fix, fixes, fixed, resolve, resolves and resolved, but only when the pull request goes into the default branch. Into any other branch the keyword is ignored and no link is made. A keyword in a commit message works too, but that pull request isn’t listed as linked. - The Development sidebar. Anyone with write access can link up to ten issues to a pull request by hand. From the pull request, the issue has to be in the same repository; from the issue’s own sidebar, the pull request or branch can be in another one.
- A linked branch.
gh issue develop 17 --checkoutcreates a branch linked to issue 17, so a run on that branch already points at its issue before a pull request exists.
Two kinds of failure fall outside all three. A pull request that names no issue, from a branch that isn’t linked either, leads nowhere. And a run on the default branch after a merge has no open pull request: to find the merged one its commit came from, search for the commit with gh pr list --search <sha> --state merged.
For failures on open pull requests, GitHub’s search does most of the join. The status:failure qualifier finds pull requests whose commits have a failed status, and the CLI can print each one with its branch and the issues it closes:
# Open pull requests with a failed status, each with the issues it closes
gh pr list --search "status:failure" \
--json number,headRefName,closingIssuesReferences \
--jq '.[] | "#\(.number) \(.headRefName) fixes: \([.closingIssuesReferences[] | "\(.repository.owner.login)/\(.repository.name)#\(.number)"] | join(", "))"'
# Failed runs on the default branch (put its name in), with the commit each one ran on
gh run list --status failure --branch <default-branch> --limit 50 \
--json databaseId,workflowName,headSha,url
# The steps that failed in one run
gh run view <run-id> --log-failedThe first command prints lines like #42 fix-login fixes: acme/app#17. An empty “fixes” means no closing keyword and no link made in the sidebar, so merging it closes nothing. A branch made with gh issue develop isn’t listed there, so check the issue’s Development sidebar before adding a keyword to the description. Run it in each repository you care about. To see failing pull requests across an organization, gh search prs --checks failure --state open --owner <org> lists them with their repository, but search results don’t carry the linked issues, so you open each one to see them.
- 1One row a runFrom the failing list
- 2PR and issueFrom the run’s links
- 3ErrorThe first failed step
When the failures span several repositories, or someone who doesn’t use a terminal needs to see them, a spreadsheet is the honest DIY answer:
- One row per failing run, copied from the Actions tab or from the commands above.
- Add the pull request and the issue from the run’s branch and the pull request’s Development sidebar. Where there’s none, write None, so a gap reads as a gap.
- Paste the first failed step’s error, a line from
--log-failed, not the whole log. - Keep the run’s address, so anyone can open the run and check it.
- Note when you copied it. A rerun can pass a minute later, and the sheet won’t know.
Then, for each row with an issue, open the issue and comment with the error and the run’s address, so whoever picks it up starts from the failure rather than from the sheet.
| Route | What it shows | What it misses |
|---|---|---|
| The Actions tab | Failing runs and their logs, per repository | Issues, and other repositories |
| A pull request’s page | Its checks and its linked issues | Runs on the default branch, and every other pull request |
| The two CLI commands | Failing pull requests with the issues they close | Issues nobody linked; one repository at a time |
| A GitHub Project | Issues and pull requests on one board | The runs: a project holds issues and pull requests, not workflow runs |
| An action that opens an issue on failure | A new failure as a comment on one “build failed” issue | The issue the work already belongs to |
| A sheet | Everything, across repositories | Anything that changed since you copied it |
The marketplace action in that table, Failed Build Issue, finds the latest open issue labelled build failed and comments on it, or opens a new one, and needs the workflow to have permission to write issues. It tells you something broke; it doesn’t connect the failure to the issue someone is already working on.
Tabless is a browser extension that builds what you ask for from the sites you allow; nothing is typed or submitted without your OK. It isn't open yet. This job is the one we use to explain it: one developer's failing builds, their issues, and a button that posts the error.
It's designed to read the pages you already have open, such as a list of failing runs and the issues they belong to, through the session your browser already has, asking before it reads each site, and to build one view with a row per failing build, its issue beside it, and a Source column. A button on each row would open the issue and post that build's error as a comment when you click it, or in a batch whose rows and text you reviewed and confirmed, one row at a time, with daily limits per site. Refresh reads the same pages again. What it reads to build a view goes to Tabless's server and an AI provider, and each site's own terms still apply.
Not for a whole repository. A pull request’s page shows its own checks and the issues linked to it, and that’s the closest GitHub gets. Failing runs are listed in the Actions tab and issues in the Issues tab, one repository at a time.
A closing keyword such as “Fixes #17” links only when the pull request goes into the default branch, and in a commit message it doesn’t list the pull request as linked. Link it by hand from the Development sidebar instead.
Not yet. Tabless isn't open, and this is one of the jobs we're building it for. Join the waitlist, and we'll let you know when you can try Tabless.