-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Open
Labels
bugSomething isn't workingSomething isn't workinggh-prrelating to the gh pr commandrelating to the gh pr commandp2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
Describe the bug
I have a GitHub actions that runs gh pr edit using the GITHUB_TOKEN created automatically for the job.
When I added
permissions:
pull-requests: writeto the workflow definition I started to get
GraphQL: Resource not accessible by integration (repository.pullRequest.projectCards.nodes)
I think it is because of this line:
Line 169 in 0ecd424
| editable.Projects.Default = pr.ProjectCards.ProjectNames() |
where the CLI tries to get the project names, but this requires the
repository-projects: read permission.
Adding repository-projects: read fixes the problem, but this took me a while to figure out and should be fixed IMO, since edits to a PR that don't involve projects shouldn't require that permission.
I am using the latest CLI version as intalled in the ubuntu-latest GitHub Actions image.
Steps to reproduce the behavior
- Create a workflow with only
pull-requests: writepermissions - Create a step that runs
gh pr edit ... - See error
Expected vs actual behavior
The gh pr edit command should succeed without additional permissions.
scottdickerson, ldayananda, ItayPodhajcer, sainu, pakrym-stripe and 68 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggh-prrelating to the gh pr commandrelating to the gh pr commandp2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions