Skip to content

ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling - #48

Merged
github-actions[bot] merged 1 commit into
mainfrom
ci/auto-merge-pat
Sep 7, 2026
Merged

ci(auto-merge): hand the sweep a PAT so workflow PRs stop stalling#48
github-actions[bot] merged 1 commit into
mainfrom
ci/auto-merge-pat

Conversation

@catomean

@catomean catomean commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

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. The failure is invisible: every run reports success and the PR simply never merges.

Not hypothetical:

PR Age when found State
ai-kit#11 — bump actions/checkout 9 days green, CLEAN, MERGEABLE
aoz-housing#122 — bump actions/upload-artifact 9 days green, CLEAN, MERGEABLE

Both had to be merged by hand today. Every Dependabot github_actions bump in the fleet is in this class, permanently.

The bigger win is 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. Measured 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 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 until FLEET_PAT exists as an organisation secret on bitbaum, and needs no second pass afterwards.

Requires (one-time, by a human): a PAT with repo + workflow scope, stored as the org secret FLEET_PAT.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P

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
@github-actions
github-actions Bot merged commit 3c6d36d into main Sep 7, 2026
1 check passed
@github-actions
github-actions Bot deleted the ci/auto-merge-pat branch September 7, 2026 15:11
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