Repository navigation
fix(ci): the bus cannot carry a PR that touches .github/workflows - #486
Merged
Merged
Conversation
Second live run. Pre-flight passed, the batch merged cleanly, the tree was
computed — and the push was rejected:
! [remote rejected] HEAD -> merge-bus/41954654344
(refusing to allow a GitHub App to create or update workflow
`.github/workflows/rust.yml` without `workflows` permission)
GitHub will not accept a push from an App-authenticated token that creates or
updates anything under `.github/workflows/`. And `workflows` is NOT a grantable
`GITHUB_TOKEN` scope — verified, not assumed: actionlint rejects it as an
unknown permission and lists the fourteen that exist, none of which is
`workflows`. So no `permissions:` line can fix this. Only a PAT carrying the
`workflow` scope could, and that would hand a long-lived credential push rights
over CI itself, which is a worse trade than hand-merging the occasional PR.
So the bus now skips such candidates at selection and says exactly why, with
what to do instead ("merge it by hand") — because a bare skip would read as the
bus being broken. Detection is `gh pr view --json files` filtered in jq, so
there is no `grep -q` to SIGPIPE.
Worth recording that the failure was clean: the rejection happens before the
remote branch exists, so nothing was left behind — no branch, no bus PR, no
merges. The push-verification step never even got to run.
Also worth recording the irony, since it is a useful warning: the PR chosen to
demonstrate the bus (#467, which adds the `workflow pins (S9)` job) is itself
exactly the class of PR the bus structurally cannot carry. The first two live
runs were spent on a candidate that could never have worked.
Simulator covers it as `workflow-touching`, asserting the skip reason, that the
other members still ride, that the excluded PR is never merged, and that the
batch still lands. Mutation-tested by deleting the exclusion. Suite now 62
assertions.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This was referenced Nov 5, 2026
athvin
added a commit
that referenced
this pull request
Nov 5, 2026
…"red" (#502) Cosmetic but misleading. `mergeStateStatus: UNSTABLE` covers a non-required check that is red *or* one that has not finished, and the bus reported it as #484 skip a non-required check is red (UNSTABLE) while #484 was in fact only queued on `record pass marker`. It went CLEAN by itself a few minutes later. Anyone reading that table would have gone hunting for a failure that did not exist. Behaviour is unchanged and was already correct: the bus takes only what GitHub calls fully clean, so a merely-pending PR is skipped this round and rides the next. Only the wording and the reasoning around it change, plus the reference gains the two states that are refused despite being hand-mergeable — pending and semgrep-only — so the conservatism is written down rather than rediscovered. Noticed while dry-running the bus for a real landing. That same run verified the #486 workflow-files exclusion in production: #498 (`deploy.yml`) was correctly skipped with "merge it by hand". Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Second live run: everything worked, then the push was rejected
Pre-flight passed (
0/5 recent runs starved), the batch merged cleanly, the tree was computed. Then GitHub refused the push.GitHub will not accept a push from an App-authenticated token that creates or updates anything under
.github/workflows/. Andworkflowsis not a grantableGITHUB_TOKENscope — verified rather than assumed: actionlint rejects it as an unknown permission and enumerates the fourteen that exist (actions, attestations, checks, contents, deployments, discussions, id-token, issues, packages, pages, pull-requests, repository-projects, security-events, statuses). None isworkflows.So no
permissions:line fixes this. Only a PAT carrying theworkflowscope could — which would hand a long-lived credential push rights over CI itself. That is a worse trade than hand-merging the occasional workflow PR.The fix
The bus skips such candidates at selection and says exactly why, including what to do instead:
A bare skip would read as the bus being broken. Detection is
gh pr view --json filesfiltered in jq, so there's nogrep -qto SIGPIPE.The failure was clean, which matters
The rejection happens before the remote branch exists, so nothing was left behind — no branch, no bus PR, no merges, verified afterwards. The push-verification step never even ran. The bus's "merge nothing unless everything is right" property held under a failure mode I hadn't anticipated.
And an irony worth recording as a warning
The PR I'd chosen to demonstrate the bus — #467, which adds the
workflow pins (S9)job — is itself exactly the class of PR the bus structurally cannot carry. Both live runs so far were spent on a candidate that could never have worked. #467 must be merged by hand.Verification
Simulator scenario
workflow-touchingasserts the skip reason, that the other members still ride, that the excluded PR is never merged, and that the batch still lands. Mutation-tested by deleting the exclusion — caught. Suite now 62 assertions.Ladder
actions: read(#482), then this. Retry needs a non-workflow PR🤖 Generated with Claude Code