Skip to content

fix(ci): make Self Auto-Merge actually start (grant write scopes; local path)#4

Merged
homelabforge merged 2 commits into
mainfrom
fix/self-auto-merge-local-path
May 28, 2026
Merged

fix(ci): make Self Auto-Merge actually start (grant write scopes; local path)#4
homelabforge merged 2 commits into
mainfrom
fix/self-auto-merge-local-path

Conversation

@homelabforge

@homelabforge homelabforge commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

The Self Auto-Merge dogfooding workflow has startup_failure on 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.yml declared no permissions:, and the reusable auto-merge job requests contents: 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 …@main path to the local ./ path — idiomatic for same-repo reusables and resolves to the caller's own commit.

Self-verifying

  • actionlint (required check on main) must pass.
  • Self Auto-Merge should now start (job skips since the actor isn't dependabot[bot]) instead of startup_failure. That transition is the proof.

Related config (already applied)

  • Enabled repo Allow auto-merge (was off).
  • Branch protection on main: require actionlint, admins exempt, no required reviews (requiring reviews would block dependabot's own auto-merge).

Security invariants preserved

  • on: pull_request (not pull_request_target) — fork PRs get a read-only token and no secrets even with the new permissions: block.
  • if: github.actor == 'dependabot[bot]' gates the merge steps.

🤖 Generated with Claude Code

homelabforge and others added 2 commits May 28, 2026 17:24
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>
@homelabforge homelabforge changed the title fix(ci): call self-auto-merge reusable by local path fix(ci): make Self Auto-Merge actually start (grant write scopes; local path) May 28, 2026
@homelabforge
homelabforge merged commit dc7a054 into main May 28, 2026
2 checks passed
@homelabforge
homelabforge deleted the fix/self-auto-merge-local-path branch May 28, 2026 22:27
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