GITHUB_TOKEN permissions that needs write access
samirergaibi opened this issue · comments
Since it's now possible to control the permissions of the GITHUB_TOKEN
on a job basis (https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/) it would be nice to know what permissions need write access to get this job to work.
I've currently set all of my repos permissions to read
and then the job failed using this action with the following error
After reading the readme I found that this is expected and is caused by not having the correct permissions.
So it would be really awesome if it could be added to the readme what permissions are required to have write access for this action to work.
I've not tested it yet, but I think you only need issues: write
.
permissions:
issues: write
Once confirmed, I'll add it to the readme.
Thank you for the fast response @peter-evans !
Looks like it needs write permission for more than just issues
, after changing it the job is set up with these permissions
EDIT:
Don't know if it might be of any help but the step looks like this:
What worked for me in the end was setting the pull-requests
scope to write
permission.
permissions:
pull-requests: write
Good to know. Thank you.
I guess it depends on your use case. i.e. Whether you are creating comments on a pull request or an issue.
I've updated the readme with details of the scopes required. Thank you for raising this and investigating!