fix(ci): main-red alarm was silent on the path that produces nearly every run - #277
Merged
Merged
Conversation
…very run #272 added the alarm on `workflow_run`. That covers pushes to main — but every merge in this repo is an auto-merge made with GITHUB_TOKEN, which fires no push event. The sweep therefore re-arms ci.yml by dispatch, and GitHub emits no `workflow_run` for a dispatched run. The alarm was blind on the path producing almost every main CI run. Proven within the hour: main went red on a66baa5 (a transient puppeteer 403 fetching chrome-headless-shell), the sweep started refusing merges again, and no issue was filed. Now dual-path, one policy: - scripts/ci/main-red-alert.sh holds the verdict logic, so the two callers cannot drift. - main-red-alert.yml keeps the push path and calls the script. - ci.yml gains a post-main job, gated to dispatched runs on main, which resolves its own verdict from the job results and calls the same script. `skipped` counts as success (jobs here are conditional on event type); failure outranks cancelled. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The hole
#272 added the red-main alarm on
workflow_run. That covers pushes to main — but every merge in this repo is an auto-merge made withGITHUB_TOKEN, which fires no push event. The sweep therefore re-armsci.ymlby dispatch, and GitHub emits noworkflow_runevent for a dispatched run.So the alarm was blind on the path that produces almost every main CI run here.
Proven within the hour of merging #272: main went red on
a66baa55, the sweep went straight back torefusing to merge onto a broken base, and no issue was filed. (Root cause of that red was transient — puppeteer's postinstall got a 403 fetchingchrome-headless-shell— and agh run rerun --failedcleared it. But nothing told anyone it had happened.)The fix — dual-path, one policy
workflow_runmain-red-alert.ymlci.yml→post-mainjobBoth call
scripts/ci/main-red-alert.sh, so the two paths cannot drift.The
post-mainjob is gated togithub.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch', resolves its own verdict from the job results (skippedcounts as success, since jobs here are conditional on event type;failureoutrankscancelled), and needs onlyissues: write.Also:
.gitignorehad a blanket*.shMy first push committed the two workflows without the script they call — which would have broken CI on merge. The repo ignores
*.shwith a hand-maintained list of per-file negations, so every new CI script needs someone to remember to add one.Replaced that footgun for this directory with
!scripts/ci/*.sh: CI scripts are part of the build contract — workflows call them by path, so a missing one breaks CI rather than merely being absent.Verification
ci.yml's original triggers and all six existing jobs are preserved (re-parsed and asserted, not eyeballed).bash -nclean on the script.🤖 Generated with Claude Code