fix: use GitHub App token for pinata PR updates#113
Open
derekmisler wants to merge 1 commit intodocker:mainfrom
Open
fix: use GitHub App token for pinata PR updates#113derekmisler wants to merge 1 commit intodocker:mainfrom
derekmisler wants to merge 1 commit intodocker:mainfrom
Conversation
4cf4196 to
b332917
Compare
Signed-off-by: Derek Misler <derek.misler@docker.com>
b332917 to
7820d7d
Compare
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.
Problem
The
update-pinatajob was failing because it usedRELEASE_TOKEN(a PAT with onlyrepoandworkflowscopes). Thegh pr edit --add-reviewercall requiresread:orgscope to resolve reviewer usernames, which this PAT lacks.Solution
Replace
RELEASE_TOKENwith a GitHub App token from thedocker-agent[bot]app, following the same pattern already used inreview-pr.yml. The app is already installed ondocker/pinatawith the necessary permissions: contents write, pull requests write, and members read (which satisfies the reviewer lookup).Changes (update-pinata job only)
Added a new first step —
Generate GitHub App token— usingtibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a(v2, same SHA pin asreview-pr.yml). The token is scoped to thepinatarepository specifically viarepositories: ["pinata"].Checkout pinata:
tokenchanged fromsecrets.RELEASE_TOKEN→steps.app-token.outputs.tokenCreate or update PR:
GH_TOKENchanged fromsecrets.RELEASE_TOKEN→steps.app-token.outputs.tokenGit identity: Updated
user.name/user.emailtodocker-agent[bot]so commits and PR actions in pinata appear under the correct bot identity.Not changed
The
releasejob still usesRELEASE_TOKEN— it needs that PAT for pushing tags and creating releases oncagent-actionitself, which the app token is not scoped to.