Skip to content

Grant secure-checkout pull-request write access - #120

Merged
kevinAlbs merged 1 commit into
mongodb-labs:mainfrom
kevinAlbs:secure-checkout-pull-requests-permission
Aug 20, 2026
Merged

Grant secure-checkout pull-request write access#120
kevinAlbs merged 1 commit into
mongodb-labs:mainfrom
kevinAlbs:secure-checkout-pull-requests-permission

Conversation

@kevinAlbs

@kevinAlbs kevinAlbs commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

secure-checkout documents:

It will write the secure global variable GH_TOKEN that can be used with the gh cli.

A recent change added permission-contents: write to secure-checkout. I expect that reduced the permissions of the created token. This permission changes appears to have broken workflows that try to create a PR: https://github.com/mongodb/mongo-php-library/actions/runs/32268117090. This appears to affect workflows in PHP and Go.

I expect we can fix this in affected workflows by creating a separate token. But since this is used by PHP and Go projects, and the README documents using the token for gh, I expect this may more appropriately fixed here.

To test: I used a temporary branch to run the workflow from my fork, which successfully drafted a PR.

The README documents that secure-checkout "will write the secure global
variable GH_TOKEN that can be used with the gh cli", but the token is minted
with `permission-contents: write` only. create-github-app-token treats any
permission-* input as an allowlist, so the token has no pull_requests access
and any `gh pr` call fails with "Resource not accessible by integration".

This broke PR creation in every merge-up workflow using secure-checkout
(mongo-php-library, mongo-php-driver, laravel-mongodb, mongo-go-driver) since
the permission was added in mongodb-labs#110. Release workflows were unaffected because
releases fall under the contents permission, so the breakage went unnoticed.
@kevinAlbs
kevinAlbs requested review from GromNaN and blink1073 August 20, 2026 13:50

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevinAlbs
kevinAlbs merged commit 8990422 into mongodb-labs:main Aug 20, 2026
7 checks passed
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.

3 participants