From 73ae4757401d0973560ac9d7e781c25101ff9baa Mon Sep 17 00:00:00 2001 From: unclee Date: Sun, 29 Mar 2026 14:57:34 +0000 Subject: [PATCH 1/2] fix: add checkout step before claude-code-action The claude-code-action requires a .git directory to function. Without checkout, git commands (config, fetch, blame, log) fail with "fatal: not a git repository", causing the entire review to abort. Also adds Read, Glob, Grep to allowedTools so Claude can read full source files for deeper context-aware review. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/code-review.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index 88a7481..93fffa4 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -36,6 +36,11 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number }} REPO: ${{ github.repository }} + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 1 + - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} @@ -67,8 +72,8 @@ jobs: Follow the guidelines in REVIEW.md if present. claude_args: | --model opus - --allowedTools "WebSearch,WebFetch,mcp__github_inline_comment__create_inline_comment,Bash(gh api:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr checks:*),Bash(git log:*),Bash(git blame:*),Bash(git diff:*)," + --allowedTools "Read,Glob,Grep,WebSearch,WebFetch,mcp__github_inline_comment__create_inline_comment,Bash(gh api:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr checks:*),Bash(git log:*),Bash(git blame:*),Bash(git diff:*)," env: GH_TOKEN: ${{ github.token }} - ANTHROPIC_BASE_URL: ${{ vars.ANTHROPIC_BASE_URL }} + ANTHROPIC_BASE_URL: ${{ vars.ANTHROPCI_BASE_URL }} ANTHROPIC_CUSTOM_HEADERS: '{"anthropic-beta": "context-1m-2025-08-07,interleaved-thinking-2025-05-14"}' From 3c846c19dc1a37efb1083d1161ee96d0d406bb07 Mon Sep 17 00:00:00 2001 From: unclee Date: Sun, 29 Mar 2026 14:59:04 +0000 Subject: [PATCH 2/2] fix: correct typo in env var name --- .github/workflows/code-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index 93fffa4..d02527a 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -75,5 +75,5 @@ jobs: --allowedTools "Read,Glob,Grep,WebSearch,WebFetch,mcp__github_inline_comment__create_inline_comment,Bash(gh api:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr checks:*),Bash(git log:*),Bash(git blame:*),Bash(git diff:*)," env: GH_TOKEN: ${{ github.token }} - ANTHROPIC_BASE_URL: ${{ vars.ANTHROPCI_BASE_URL }} + ANTHROPIC_BASE_URL: ${{ vars.ANTHROPIC_BASE_URL }} ANTHROPIC_CUSTOM_HEADERS: '{"anthropic-beta": "context-1m-2025-08-07,interleaved-thinking-2025-05-14"}'