Skip to content

Commit 9793c0a

Browse files
natemcmasterclaude
andcommitted
chore: allow Claude Code reviews on fork PRs
Use pull_request_target for auto-reviews so the workflow runs in the base repo context with access to secrets, while safely checking out only the base branch. Remove fork restrictions from the interactive workflow since those events already run in the base repo context. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 00efd06 commit 9793c0a

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
name: Claude Code Review
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, synchronize]
66

77
jobs:
88
claude-review:
9-
# Only run on PRs from branches in the same repository, not from forks
10-
if: github.event.pull_request.head.repo.full_name == github.repository
119
runs-on: ubuntu-latest
1210
permissions:
1311
contents: read

.github/workflows/claude.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ jobs:
1818
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
1919
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
2020
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
21-
) && (
22-
github.event_name == 'issues' ||
23-
github.event_name == 'issue_comment' ||
24-
github.event.pull_request.head.repo.full_name == github.repository
2521
)
2622
runs-on: ubuntu-latest
2723
permissions:

0 commit comments

Comments
 (0)