Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,35 @@ jobs:
id-token: write

steps:
# IMPORTANT: checkout BASE repo only (safe on forks)
- name: Checkout base repo (safe)
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Ensure ~/.local/bin exists and is on PATH
run: |
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"


- name: Run Claude Code Review
uses: anthropics/claude-code-action@v1
env:
# Ensure the action can execute the Claude CLI it installs.
PATH: /home/runner/.local/bin:${{ env.PATH }}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a hardcoded path /home/runner/.local/bin reduces portability across different runner environments. Consider using $HOME/.local/bin instead to maintain consistency with the previous approach while being more flexible.

Suggested change
PATH: /home/runner/.local/bin:${{ env.PATH }}
PATH: $HOME/.local/bin:${{ env.PATH }}

Copilot uses AI. Check for mistakes.
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ github.token }}

plugin_marketplaces: "https://github.com/anthropics/claude-code.git"
plugins: "code-review@claude-code-plugins"

show_full_output: true

claude_args: >
--dangerously-skip-permissions
--max-turns 60
--max-turns 80
--allowedTools
"Bash(gh:*)"
"Bash(gh pr view:*)"
"Bash(gh pr diff:*)"
"Bash(gh pr comment:*)"
"Bash(gh api:*)"
"Bash(cat:*)"
"Bash(ls:*)"
"Bash(find:*)"
"Bash(grep:*)"
"Bash(sed:*)"
"Bash(awk:*)"
Expand All @@ -57,31 +58,30 @@ jobs:
"Bash(python3:*)"

prompt: |
You are running in pull_request_target. DO NOT execute or inspect PR fork code.
Review ONLY via GitHub API/gh commands.
You are running in pull_request_target.
DO NOT read or inspect any checked-out PR/fork code. Review ONLY using GitHub API/gh commands.

Read local guidance ONLY from:
- CLAUDE.md (root) if present
- .claude/rules/*.md if present
Do NOT read any other workspace files.
You may read local guidance ONLY from:
- ./CLAUDE.md (root) if present
- ./.claude/rules/*.md if present (max 10 files)

Keep tool calls minimal:
1) ls .claude/rules || true
2) If CLAUDE.md exists: cat CLAUDE.md
3) If .claude/rules exists: cat each .md file directly (no loops; at most 10 files)
Keep tool calls minimal and in this order:
1) ls -1 .claude/rules 2>/dev/null || true
2) cat CLAUDE.md 2>/dev/null || true
3) find .claude/rules -maxdepth 1 -name "*.md" -print | head -n 10 | xargs -I{} cat "{}" 2>/dev/null || true
4) gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json title,body,files,changedFiles,additions,deletions,headRefOid
5) gh pr diff ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
6) Post ONE top-level comment.
6) Post ONE top-level PR comment, then STOP.

Output format:
- Head SHA
- Files changed count + list up to 10 file paths
- Summary (3–6 bullets)
- Summary (3–6 bullets, minimal)
- Findings with file + line numbers when possible
- If no issues: 0–3 improvement opportunities (only if confident)

Post ONE top-level PR comment titled "Claude Code Review".
Then stop.
If posting is blocked, write the full review to the GitHub Actions job summary instead, then STOP.

additional_permissions: |
actions: read