ci(pr-rebase): do not force-push a head the run token cannot get checked (#2082) #2085
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!2085
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1119-0402"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2082
What was wrong.
pr-rebase.ymlforce-pushes a pull-request branch withTOKEN: ${{ secrets.FORGEJO_TOKEN || secrets.GITHUB_TOKEN || github.token }}. When the secret is absent that resolves to the run token, and on this instance a push made with the run token lands on the branch but raises nopull_requestevent - no run is created for the head it mints (/actions/taskshas no row at all, so it was never created, not cancelled). That head replaces one that had checks, sits on currentmainso no later pass revisits it, and can never be armed, becausemerge_when_checks_succeedis evaluated against an empty status set. The permanent 0-status pull request in #2082. The stuck heads carry exactly the committer this file sets,packetforge-bot@users.noreply.git.jayw.uk.auto-rebase.ymllearned this on 2026-11-18 and refuses the push;pr-rebase.yml- the job that fires on every push to every pull request - did not.What changed.
pr-rebase.yml:RUN_TOKEN: ${{ github.token }}is carried in the rebase step, and a pass holding nothing but the run token now leaves the branch as the author wrote it, before paying for a checkout, and says why with the remedy (a user token inFORGEJO_TOKEN). Behind main is a pull request that can still merge on the checks it has; a head nothing checks cannot merge at all.scripts/check-rebase-push-guard.js: audits every workflow as text for a force-push of a pull-request branch (git push --force-with-lease ... refs/heads/) whose step has noRUN_TOKEN, noTOKEN/RUN_TOKENcomparison, or a comparison that does not stop the pass.test/rebase-push-guard.test.js: the three bad shapes on fixtures, a commented-out guard, and both real maintenance workflows.Verified.
node scripts/syntax-check.js: 438 files, all OK.node scripts/run-tests.js --filter=rebase-push-guard: 6 assertions, 0 failed (the real-workflow assertion fails onorigin/mainwithE_NO_RUN_TOKENat pr-rebase.yml:140).bash -non the extracted step. Disk-hygiene and closed-issues suites still green (12 and 36 assertions).Not fixed here. The server-side reason a run token push raises no event (act_runner / Forgejo pull_request fan-out) is outside this repository; this change stops the queue being drained into that hole. Setting
FORGEJO_TOKENto a user token remains the cure for the rebases themselves.