ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling - #48
Merged
Conversation
GITHUB_TOKEN cannot merge a PR that touches .github/workflows. The sweep tries, the merge API refuses, it logs "leaving for the next sweep", and repeats — while still exiting 0. So the failure is invisible: every run reports success and the PR simply never merges. That is not hypothetical. ai-kit #11 (bump actions/checkout) sat green, CLEAN and MERGEABLE for nine days; aoz-housing #122 (bump actions/upload-artifact) for nine more. Both had to be merged by hand today. Every Dependabot `github_actions` bump in the fleet is in this class, permanently. A PAT fixes a second thing that costs more: THROUGHPUT. A dispatch made with GITHUB_TOKEN emits no workflow_run, so after each merge nothing wakes the sweep to take the next PR — it waits for the cron, and GitHub throttles scheduled workflows to roughly hourly regardless of what the cron says. Observed in fleetcrown: sweeps ~50-65 minutes apart against a */10 schedule. A PAT-created dispatch does emit workflow_run, so the queue drains at CI speed instead. The reusable workflow has always supported this — GH_TOKEN is `secrets.token || github.token`. This just passes it. SAFE BEFORE THE SECRET EXISTS: an undefined secret resolves to empty, and the fallback picks github.token. So this changes nothing until FLEET_PAT is created as an organisation secret, and needs no second pass afterwards. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
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.
GITHUB_TOKENcannot merge a PR that touches.github/workflows. The sweep tries, the merge API refuses, it logs "leaving for the next sweep", and repeats — while still exiting 0. The failure is invisible: every run reports success and the PR simply never merges.Not hypothetical:
ai-kit#11— bump actions/checkoutaoz-housing#122— bump actions/upload-artifactBoth had to be merged by hand today. Every Dependabot
github_actionsbump in the fleet is in this class, permanently.The bigger win is throughput
A dispatch made with
GITHUB_TOKENemits noworkflow_run. So after each merge, nothing wakes the sweep to take the next PR — it waits for the cron, and GitHub throttles scheduled workflows to roughly hourly regardless of what the cron says. Measured in fleetcrown: sweeps 50–65 minutes apart against a*/10schedule.A PAT-created dispatch does emit
workflow_run, so the queue drains at CI speed instead of at the schedule's.Why this is safe to merge now
The reusable workflow has always supported it —
GH_TOKEN: ${{ secrets.token || github.token }}. This PR only passes the secret through.An undefined secret resolves to empty, and the fallback picks
github.token. So this changes nothing untilFLEET_PATexists as an organisation secret onbitbaum, and needs no second pass afterwards.Requires (one-time, by a human): a PAT with
repo+workflowscope, stored as the org secretFLEET_PAT.🤖 Generated with Claude Code
https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P