Repository navigation
Tell the owner when a run started by a bot fails - #86
Merged
Merged
Conversation
GitHub emails a failed run only to whoever started it. A run started by Dependabot, or by the app that merges its pull requests, therefore reaches nobody: a pull request with auto-merge enabled sits open, or main stays broken, without a word. Downloads from the package sites failed three times in two days, so this will happen. - ci.yml: a report-failure job opens a ci-failure issue assigned to the repository owner when the build, dependency-submission or dependency-review job fails in a run the owner did not start. The issue gives the command to run the failed jobs again. Pull requests from forks and cancelled jobs are not reported. - dependabot-auto-merge.yml: if the auto-merge job fails, a last step comments on the pull request and mentions the owner. It uses the built-in token, never the app's. - CLAUDE.md: describe both, and say to approve a publish only for a run the owner started. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ffDfV5858ERd3MkYFRJUN
Review of the previous commit found the notice correct but its text wrong in two cases, and one issue per failed run more than is useful. - One open ci-failure issue collects the failures. A later failure becomes a comment on it, so an outage at a package site does not open an issue per run. If the search or the comment fails, an issue is opened anyway. - The advice now depends on what failed. A pull request whose only failure is dependency-review can still merge, because only the Java jobs are required checks, and the notice says so. A failed build on main no longer claims the dependency baseline is missing when dependency-submission passed. - Outside pull requests a cancelled job is reported too. Nothing cancels those runs on purpose, so it means a job ran past its time limit. - The issue title is cut to 200 characters, under GitHub's limit. - dependabot-auto-merge.yml: the guard comment names the new last step as its one exception. CLAUDE.md follows. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ffDfV5858ERd3MkYFRJUN
Review of the previous commit found it correct, with one thing that would mislead: the collecting issue kept the title of its first failure, so a broken main could arrive as a comment under an old pull request's name. - The issue title is now the same for every failure, "CI failed in a run nobody was emailed about". Each failure still names itself in the first line of the issue or comment. The title no longer needs cutting to length. - The lookup of an open notice lists issues directly instead of searching. A search lags behind an issue opened moments ago, which is exactly when several failures arrive together. - Advice text: a failed build on main with the baseline recorded no longer says it is unknown whether main builds; a failed dependency-review says the pull request has probably merged and to read the log; a cancelled job gets a sentence saying what that means. - The comment above the job says that a pull request job running past its time limit is not reported. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018ffDfV5858ERd3MkYFRJUN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
GitHub emails a failed workflow run only to whoever started it. Two kinds of run are started by nobody who reads email:
When one of these fails, nothing tells the repository owner. A Dependabot pull request with auto-merge enabled then sits open, or main stays broken. This is not hypothetical: a download from a package site failed three times on 2026-11-21 and 22, once on main after the app merged #83.
Changes
ci.yml, newreport-failurejob). It runs when the build,dependency-submissionordependency-reviewjob fails, and opens aci-failureissue assigned to the repository owner. The issue shows each job's result and gives the command to run the failed jobs again.ci-failureissue is already open, the job comments on it instead of opening another, so an outage at a package site does not produce one issue per run. The issue has a fixed title, and each failure names itself in the first line of the issue or comment. Failures that land in the same few seconds can still open one each. The owner closes the issue once dealt with.dependency-reviewfailed on a pull request, the notice says the pull request has probably merged anyway, because that job is not a required check, and to read its log. If the build failed on main but the dependency baseline was recorded, it says so. A cancelled job gets a sentence saying what that means.dependabot-auto-merge.yml, new last step). It comments on the pull request and mentions the owner. It uses the built-in token, never the app's, and needs no new permission.CLAUDE.md: describes both, and adds one rule for publishing: approve themaven-centralenvironment only for a run you started.What was tested
The two scripts were run as they appear in the workflow files, with a stand-in for the
ghcommand:GitHub's own records confirm who the "starter" is in each case: the three merges on 2026-11-22 show
northpost-automerge[bot]for the app's merges and the owner's login for the owner's.Not testable before it happens: the job's condition as GitHub evaluates it, and that the issue and the comment produce an email. This pull request's own run is started by the owner, so the new job is skipped on it. No workflow has opened an issue in this repository yet, so the first real failure is also the first real test of that.
Known limits
🤖 Generated with Claude Code
https://claude.ai/code/session_018ffDfV5858ERd3MkYFRJUN