Skip to content

Use reviewer bot token to enable auto-merge in all templates - #1449

Merged
dmikusa merged 3 commits into
mainfrom
fix/auto-merge-reviewer-token
Oct 27, 2026
Merged

dmikusa merged 3 commits into
mainfrom
fix/auto-merge-reviewer-token

Conversation

@dmikusa

@dmikusa dmikusa commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Problem

The Enable Auto-Merge step uses PAKETO_BOT_GITHUB_TOKEN (write) in the language-family, library, and builder templates. enablePullRequestAutoMerge requires push access to the protected base branch, so repos with "Restrict who can push to matching branches" enabled on main fail with:

GraphQL: Pull request User is not authorized for this protected branch (enablePullRequestAutoMerge)

This is currently breaking:

  • paketo-buildpacks/java
  • paketo-community/rust
  • paketo-buildpacks/libpak-tools

and will break java-native-image, builder-jammy-java-tiny, and builder-noble-java-tiny once a bot PR reaches that step.

Fix

Use PAKETO_BOT_REVIEWER_GITHUB_TOKEN (admin) for the auto-merge step, matching the implementation template (fixed in #1381).

Rollout

Existing repos pick this up through the update-github-config sync workflow. The first sync PR in the affected repos will need to be merged manually, because the broken auto-merge is what would normally merge it.

Note

This PR was written by opencode and reviewed by a human.

`enablePullRequestAutoMerge` requires push access to the protected base
branch. Repos with "Restrict who can push" enabled on `main` reject the
write-level `paketo-bot` token with "Pull request User is not authorized
for this protected branch", while the admin-level reviewer bot bypasses
the restriction.

Apply the same fix already made to the implementation template in #1381
to the language-family (java, rust), library (libpak-tools), and builder
templates.
@dmikusa
dmikusa requested review from a team as code owners October 25, 2026 04:01
@dmikusa
dmikusa requested review from jericop and modulo11 October 25, 2026 04:01
@dmikusa
dmikusa enabled auto-merge (squash) October 27, 2026 20:12
@dmikusa
dmikusa merged commit b528ac3 into main Oct 27, 2026
4 checks passed
@dmikusa
dmikusa deleted the fix/auto-merge-reviewer-token branch October 27, 2026 20:14
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.

2 participants