Skip to content

Commit 292d598

Browse files
committed
ci(auto-sync): grant issues:write so gh label create works
The label-management API (POST /repos/{owner}/{repo}/labels) requires 'issues: write'. When a workflow declares any explicit permissions, all unlisted scopes default to 'none' — so the existing block silently denied label creation. The PR-creation step then failed with 'could not add label: auto-sync not found'. Also drop '2>/dev/null' on the idempotent label-create so future failures surface in logs instead of being swallowed.
1 parent 8a2e2e0 commit 292d598

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/auto-sync-upstream.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
permissions:
1010
contents: write
1111
pull-requests: write
12+
issues: write
1213
actions: write
1314

1415
concurrency:
@@ -150,7 +151,7 @@ jobs:
150151
} > /tmp/pr-body.md
151152
152153
# Idempotently ensure the label exists.
153-
gh label create auto-sync --color FBCA04 --description "Automated upstream sync" 2>/dev/null || true
154+
gh label create auto-sync --color FBCA04 --description "Automated upstream sync" || true
154155
155156
EXISTING=$(gh pr list --head "${PR_BRANCH}" --base "${TARGET_BRANCH}" --state open --json number --jq '.[0].number' || true)
156157

0 commit comments

Comments
 (0)