Repository navigation
Grant pull-requests: write to the issue labeler workflow - #347
Merged
Merged
Conversation
The labeler runs on pull_request_target, but the GITHUB_TOKEN only had issues: write. Adding a label to a pull request with that token returns 403 "Resource not accessible by integration", which github/issue-labeler surfaces only as a bare AggregateError. The workflow has failed on every allowlist PR since it was added in #311. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 55098ea5-f0c8-4d32-abd9-63f14567c426
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the workflow token-permission update.
No open issues 🎉
What changed in this PR
Updates the Issue Labeler workflow’s token permissions so it can apply the allowlist label to pull requests, addressing the triage failures reported since #311.
Changes:
- Adds
pull-requests: writewhile retaining the existing issue-write and contents-read permissions.
| File | Description |
|---|---|
.github/workflows/issue-labeler.yml |
Grants the permission needed to label pull requests. |
Review effort: Balanced
jurre
approved these changes
Oct 30, 2026
jurre
left a comment
Member
There was a problem hiding this comment.
Kind of sounds like this might be better off as a copilot cloud workflow, but this will work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Issue Labeler runs on
pull_request_target, but its token could only write issues. Adding a label to a pull request needspull-requests: write, so everyallowlistPR since #311 failed triage with a bareAggregateError(e.g. #346, and the castai and go.dev allowlist PRs).permissions: issues: write + pull-requests: write contents: readEvidence
Reproduced in a scratch repo running this exact workflow (same pinned
github/issue-labelerSHA and rules) against a PR titled "Allowlist …":issues: writeonly): the action fails withCould not add label(s) allowlist→AggregateError. Calling the same endpoint directly with the token shows the real error:POST /repos/{repo}/issues/1/labels→403 Resource not accessible by integrationAfter (
+ pull-requests: write): run succeeds and the PR is labelledallowlist.Merge Danger
Door: two-way
Revert the one line to undo it.
Blast Radius: small
Only this workflow's token gains PR write access. The workflow checks out no PR code and only runs the pinned labeler action, so the extra scope isn't reachable by fork contributors.