From 8184283ab094684ce3b2e0d176ac091665b0a18e Mon Sep 17 00:00:00 2001 From: J3vb Date: Thu, 2 Apr 2026 17:36:16 +0200 Subject: [PATCH] fix: enable Claude Code Review for fork PRs via pull_request_target OIDC tokens are not available for fork PRs with pull_request trigger. Switch to pull_request_target and checkout the PR head SHA explicitly. Also grant pull-requests: write so the action can post review comments. --- .github/workflows/claude-code-review.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index b5e8cfd4..f26cfba2 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -1,7 +1,7 @@ name: Claude Code Review on: - pull_request: + pull_request_target: types: [opened, synchronize, ready_for_review, reopened] # Optional: Only run on specific file changes # paths: @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - pull-requests: read + pull-requests: write issues: read id-token: write @@ -29,6 +29,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 1 - name: Run Claude Code Review