Grant the merge-up app token pull-requests write access - #1963
Closed
kevinAlbs wants to merge 1 commit into
Closed
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
Closing in favor of upstream fix: mongodb-labs/drivers-github-tools#120 |
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.
A recent change in drivers-github-tools added
permission-contents: writetosecure-checkout. I expect that reduced the permissions of the created token.secure-checkoutpersists the created token, which is later used by theautomatic-merge-up-action. I expect this is the cause of a permission error inmerge-up.