fix(ci): make Self Auto-Merge actually start (grant write scopes; local path)#4
Merged
Merged
Conversation
The Self Auto-Merge dogfooding workflow startup-failed on every PR since it was added (3/3 runs) because it referenced its own reusable via the full owner/repo path pinned @main. A same-repo reusable referenced that way startup-fails on pull_request; the local ./ path resolves to the caller's own commit (no self-lag) and is GitHub's documented same-repo pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The actual cause of the startup_failure: the repo default workflow token is read-only, this caller declared no permissions, and the reusable auto-merge job requests contents: write / pull-requests: write — so GitHub rejected the run at startup. Grant those scopes on the caller. (The prior local-path change was a valid cleanup but not the fix.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
The Self Auto-Merge dogfooding workflow has
startup_failureon every run since it was added in v1.3.1 (never once succeeded).Actual root cause: the repo's default workflow token is read-only,
self-auto-merge.ymldeclared nopermissions:, and the reusableauto-mergejob requestscontents: write+pull-requests: write. GitHub rejects the run at startup ("requesting contents: write... but only allowed contents: read"). Fixed by granting those scopes on the caller.Also (secondary cleanup, not the cause): switched the reusable call from the full
…@mainpath to the local./path — idiomatic for same-repo reusables and resolves to the caller's own commit.Self-verifying
actionlint(required check onmain) must pass.dependabot[bot]) instead ofstartup_failure. That transition is the proof.Related config (already applied)
main: requireactionlint, admins exempt, no required reviews (requiring reviews would block dependabot's own auto-merge).Security invariants preserved
on: pull_request(notpull_request_target) — fork PRs get a read-only token and no secrets even with the newpermissions:block.if: github.actor == 'dependabot[bot]'gates the merge steps.🤖 Generated with Claude Code