Skip to content

Commit 7145962

Browse files
committed
ci: run sync-pr-labels on pull_request_target only
Fork PRs receive a read-only GITHUB_TOKEN on pull_request, so issues.addLabels fails with 403. This workflow only uses the API (no PR checkout), so pull_request_target is the correct trigger. Made-with: Cursor
1 parent ac7c493 commit 7145962

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/sync-pr-labels.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Sync PR Labels
22

3+
# Use pull_request_target only: fork PRs get a read-only GITHUB_TOKEN on
4+
# pull_request, so issues.addLabels returns 403. This job only calls the API
5+
# (no checkout of PR code), which is the safe pattern for pull_request_target.
36
on:
4-
pull_request:
5-
types: [opened, reopened, synchronize, edited]
67
pull_request_target:
78
types: [opened, reopened, synchronize, edited]
89

0 commit comments

Comments
 (0)