fix: grant pull-requests: write permission in label-pr-intent workflow#1612
Conversation
Agent-Logs-Url: https://github.com/github/awesome-copilot/sessions/02960aad-3fd4-45cf-b9d1-9aa219e14604 Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request fixes a failing GitHub Actions workflow by adjusting the GITHUB_TOKEN permissions so the label-pr job can successfully apply labels to pull requests without hitting HTTP 403 errors.
Changes:
- Updated the workflow
permissionsto grantpull-requests: write(previouslyread) alongsideissues: write.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/label-pr-intent.yml |
Grants pull-requests: write so the label-application job can label PRs successfully. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
|
@copilot still failed |
The CI failure on this PR is expected due to how The fix is correct and will take effect for all PRs once this is merged into |
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.stagedbranch for this pull request.Description
The
label-prjob was failing with HTTP 403 on every PR. The GitHub API for adding labels (POST /issues/{number}/labels) requires bothissues=writeandpull_requests=write— the workflow only grantedpull-requests: read, which was insufficient.Fix: bump
pull-requestspermission fromread→writeinlabel-pr-intent.yml:The
x-accepted-github-permissions: issues=write; pull_requests=writeresponse header from the failing API call confirmed both scopes are required.Type of Contribution
Additional Notes
Affected job:
label-pr/ run 25345875449By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.