What GitHub Actions permission scope allows a workflow to approve pull requests?
Select an answer to reveal the explanation.
Short Explanation and Infographic
pull-requests:write is the permission that lets GITHUB_TOKEN interact with PR reviews — create, update, approve, and dismiss.
Full explanation below image
Full Explanation
The 'pull-requests: write' permission allows GITHUB_TOKEN to create, update, and delete pull request reviews, create and delete comments on pull requests, and merge pull requests. 'contents: write' allows writing to the repository code, creating releases, and pushing commits. 'checks: write' allows creating and updating check runs and check suites. 'reviews: write' is not a valid permission scope — reviews fall under 'pull-requests'. Note: a workflow cannot approve its own pull request using GITHUB_TOKEN — this is a security restriction to prevent self-approval of automated changes.