Skip to content

What scopes are needed for a GITHUB_TOKEN to write secrets to a repository? #3164

Answered by rr-tom-noble
TSNoble asked this question in Q&A
Discussion options

You must be logged in to vote

Fixed by using a GitHub App and obtaining a token. For those wondering, the steps are as follows:

  • Create new GitHub App
  • Set permissions (in this case secrets: read and write)
  • Install the App into the relevant Repositories (has a similar effect to a fine-scoped PAT)
  • Generate a private key for the App
  • Store the App ID and private key as Secrets in the Repository wishing to use the token
  • Use the Create Github App Token action in a workflow to generate a token
  • Any PAT usage can be replaced with this token

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by joshmgross
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants