Skip to content

Commit 2e3e4c7

Browse files
olaservoclaude
andauthored
ci: run readme-pr-check on pull_request_target so fork PRs can be labeled (#4739)
Observed on #4714 and #4726: addLabels returned 403 "Resource not accessible by integration" because pull_request gives fork PRs a read-only token. The job only calls the GitHub API and never checks out PR code, so pull_request_target is safe here. Claude-Session: https://claude.ai/code/session_01CK8vvB229h6orvkokG8YxU Co-authored-by: Claude Fable 5 <[email protected]>
1 parent 3aa19f5 commit 2e3e4c7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎.github/workflows/readme-pr-check.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: README PR Check
22

33
on:
4-
pull_request:
4+
# pull_request_target, not pull_request: fork PRs get a read-only token under
5+
# pull_request, so the label and comment calls fail with 403. This job only
6+
# calls the API and never checks out PR code, so the write token is safe.
7+
pull_request_target:
58
types: [opened]
69
paths:
710
- 'README.md'
@@ -10,7 +13,7 @@ on:
1013

1114
jobs:
1215
check-readme-only:
13-
if: github.event_name == 'pull_request'
16+
if: github.event_name == 'pull_request_target'
1417
runs-on: ubuntu-latest
1518
permissions:
1619
contents: read

0 commit comments

Comments
 (0)