Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Commit 2e53efc

Browse files
committed
fix(ci): grant issues:write to pr-labeler workflow
addLabels and removeLabel call the issues API endpoint (POST /repos/.../issues/{number}/labels) even when the target is a pull request. Without 'issues: write' the workflow token cannot mutate labels and the call returns HTTP 403 'Resource not accessible by integration'. The previous 'pull-requests: write' grant covers the PR conversation surface — comments, reviewers, merge state — but not labels, which GitHub treats as an issues resource. Add the missing scope and document the reasoning inline so a future reader does not retry the same mistake. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
1 parent 92ff040 commit 2e53efc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎.github/workflows/pr-labeler.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ on:
66

77
permissions:
88
contents: read
9+
# `pull-requests: write` is required for editing the PR conversation
10+
# surface (comments, reviewers). Labels live behind the issues API
11+
# (`POST /repos/.../issues/{n}/labels`), so adding or removing them on
12+
# a PR needs `issues: write` even when the target is a pull request.
13+
# Without this scope, github.rest.issues.addLabels fails with
14+
# `Resource not accessible by integration` (HTTP 403).
915
pull-requests: write
16+
issues: write
1017

1118
# Coalesce rapid edited/synchronize bursts on the same PR so an older run
1219
# cannot land its label mutations after a newer run computed a different set.

0 commit comments

Comments
 (0)