Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document GitHub fine-grained personal token permissions #353

Open
Siilwyn opened this issue May 1, 2023 · 4 comments
Open

Document GitHub fine-grained personal token permissions #353

Siilwyn opened this issue May 1, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Siilwyn
Copy link
Contributor

Siilwyn commented May 1, 2023

Thoughts on adding needed permissions to the readme?

After some trial and error it seems that the 'new' personal access tokens need the following permissions:
image

@Siilwyn Siilwyn added the bug Something isn't working label May 1, 2023
@davidar
Copy link

davidar commented May 10, 2023

You can also use GITHUB_TOKEN with these permissions:

permissions: 
   contents: read 
   pull-requests: write 
   deployments: write

@Siilwyn
Copy link
Contributor Author

Siilwyn commented May 12, 2023

@davidar oh that's possibly a lot better! No more generating tokens on a 'bot' GH account. Are there any downsides to this? I don't see it mentioned in the readme.
Guess the GH PR comment author would be 'less nice'?

@davidar
Copy link

davidar commented May 13, 2023

I haven't noticed any downsides, it just means the comments come from the "github-actions" bot

@pm0u
Copy link

pm0u commented May 21, 2024

You can also use GITHUB_TOKEN with these permissions:

permissions: 
   contents: read 
   pull-requests: write 
   deployments: write

is this a yaml config that we set somewhere or are you just noting the permissions needed when creating the fine grained token?

Edit: got it, hadn't seen this before:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

then you can just use the secret without having to generate anything
https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants