Skip to content

Grant the merge-up app token pull-requests write access - #1963

Closed
kevinAlbs wants to merge 1 commit into
mongodb:v2.3from
kevinAlbs:merge-up-token-permissions
Closed

Grant the merge-up app token pull-requests write access#1963
kevinAlbs wants to merge 1 commit into
mongodb:v2.3from
kevinAlbs:merge-up-token-permissions

Conversation

@kevinAlbs

@kevinAlbs kevinAlbs commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

A recent change in drivers-github-tools added permission-contents: write to secure-checkout. I expect that reduced the permissions of the created token. secure-checkout persists the created token, which is later used by the automatic-merge-up-action. I expect this is the cause of a permission error in merge-up.

secure-checkout@v3 mints the app token with `permission-contents: write`,
which create-github-app-token treats as an allowlist, so the token has no
`pull_requests` permission. The branch push succeeds and `createPullRequest`
fails with "Resource not accessible by integration".

The `permissions:` block does not help: it scopes GITHUB_TOKEN, while
automatic-merge-up-action declares no token input and shells out to `gh`,
which reads the GH_TOKEN that secure-checkout writes to $GITHUB_ENV. The
`pull-requests: write` grant applies to a token that is never used.

Mint the token here instead, requesting both permissions, and pass it
explicitly to the steps that need it. This matches how every other
drivers-github-tools action takes a `token` input rather than relying on an
ambient credential, and makes the token visible at the call site.
Comment thread .github/workflows/merge-up.yml
Comment thread .github/workflows/merge-up.yml
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kevinAlbs kevinAlbs closed this Aug 20, 2026
@kevinAlbs kevinAlbs reopened this Aug 20, 2026
@kevinAlbs

Copy link
Copy Markdown
Contributor Author

Closing in favor of upstream fix: mongodb-labs/drivers-github-tools#120

@kevinAlbs kevinAlbs closed this Aug 20, 2026
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