Skip to content

fix(ci): main-red alarm was silent on the path that produces nearly every run - #277

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/main-red-alert-dispatch
Aug 6, 2026
Merged

fix(ci): main-red alarm was silent on the path that produces nearly every run#277
github-actions[bot] merged 1 commit into
mainfrom
ci/main-red-alert-dispatch

Conversation

@catomean

@catomean catomean commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

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 with GITHUB_TOKEN, which fires no push event. The sweep therefore re-arms ci.yml by dispatch, and GitHub emits no workflow_run event 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 to refusing to merge onto a broken base, and no issue was filed. (Root cause of that red was transient — puppeteer's postinstall got a 403 fetching chrome-headless-shell — and a gh run rerun --failed cleared it. But nothing told anyone it had happened.)

The fix — dual-path, one policy

Path Trigger Caller
push to main workflow_run main-red-alert.yml
auto-merge re-arm dispatched run ci.ymlpost-main job

Both call scripts/ci/main-red-alert.sh, so the two paths cannot drift.

The post-main job is gated to github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch', resolves its own verdict from the job results (skipped counts as success, since jobs here are conditional on event type; failure outranks cancelled), and needs only issues: write.

Also: .gitignore had a blanket *.sh

My first push committed the two workflows without the script they call — which would have broken CI on merge. The repo ignores *.sh with 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

  • Both workflow files parse; ci.yml's original triggers and all six existing jobs are preserved (re-parsed and asserted, not eyeballed).
  • bash -n clean on the script.
  • Verdict logic unit-tested across the combinations:
success success success success     -> success
success skipped skipped success     -> success
success failure success success     -> failure
success cancelled success success   -> cancelled
failure cancelled success success   -> failure

🤖 Generated with Claude Code

…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>
@github-actions
github-actions Bot merged commit 2b6f58b into main Aug 6, 2026
8 checks passed
@github-actions
github-actions Bot deleted the ci/main-red-alert-dispatch branch August 6, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant