Skip to content

Commit 18d7cee

Browse files
authored
chore: use pull_request_target for auto-labeler on fork PRs (#488)
fix: use pull_request_target for auto-labeler on fork PRs When a PR is opened from a fork repository, the GITHUB_TOKEN in pull_request events only has read permissions, preventing the autolabeler from adding labels. Using pull_request_target runs the workflow in the context of the base repository with write permissions, which is safe since the autolabeler only reads PR metadata and adds labels without checking out any code. Fixes auto-labeler failing on PR #487 from a fork.
1 parent cb0c44f commit 18d7cee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎.github/workflows/labeler.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: PR Auto-labeler
22

33
on:
4-
# pull_request event is required for auto-labeler
5-
pull_request:
4+
# pull_request_target event is required for auto-labeler on fork PRs
5+
pull_request_target:
66
types: [opened, reopened, synchronize]
77

88
permissions: {}

0 commit comments

Comments
 (0)