Skip to content

fix(ci): the bus cannot carry a PR that touches .github/workflows - #486

Merged
athvin merged 1 commit into
mainfrom
bm/ci-merge-bus-workflow-files
Nov 5, 2026
Merged

athvin merged 1 commit into
mainfrom
bm/ci-merge-bus-workflow-files

Conversation

@athvin

@athvin athvin commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Second live run: everything worked, then 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)

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/. And workflows is not a grantable GITHUB_TOKEN scope — 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 is workflows.

So no permissions: line fixes this. Only a PAT carrying the workflow scope 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:

#108   skip   touches .github/workflows/ — GITHUB_TOKEN may not push
               workflow changes, so merge it by hand

A bare skip would read as the bus being broken. Detection is gh pr view --json files filtered in jq, so there's no grep -q to 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-touching asserts 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

Rung Result
1. dry run, nothing labelled ✅ live
2. dry run with a candidate ✅ live
3. real landing ❌ twice — actions: read (#482), then this. Retry needs a non-workflow PR

🤖 Generated with Claude Code

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]>
@athvin
athvin merged commit ab9eac1 into main Nov 5, 2026
36 checks passed
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]>
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.

2 participants