diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 121f2a1ab..bec428146 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -1,58 +1,34 @@ name: 🤖 Claude Code Review - on: - # Manual trigger - workflow_dispatch: - inputs: - pr_number: - description: 'PR number to review' - required: true - type: string - - # Trigger on specific comment containing '/claude-review' issue_comment: types: [created] - # Trigger when 'review-requested' label is added to PR - pull_request: - types: [labeled] - jobs: - claude-review: - # Only run if: - # 1. Manual trigger, OR - # 2. Comment contains '/claude-review', OR - # 3. Label 'review-requested' was added - if: | - github.event_name == 'workflow_dispatch' || - (github.event_name == 'issue_comment' && - github.event.issue.pull_request && - contains(github.event.comment.body, '/claude-review')) || - (github.event_name == 'pull_request' && - github.event.action == 'labeled' && - github.event.label.name == 'review-requested') - + review: + # Only run for PR comments and when the body contains our trigger command + if: > + github.event.issue.pull_request != null && + ( + contains(github.event.comment.body, '/claude-review') + ) runs-on: ubuntu-latest permissions: contents: read pull-requests: write - issues: write id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4 + - uses: actions/checkout@v6 with: + ref: refs/pull/${{ github.event.issue.number }}/head fetch-depth: 1 - - name: Run Claude Code Review - id: claude-review - uses: anthropics/claude-code-action@v1 + - uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - + track_progress: true # ✨ Enables tracking comments prompt: | - ${{ github.event_name == 'workflow_dispatch' && format('Review PR #{0} in {1}.', github.event.inputs.pr_number, github.repository) || '' }} + REPO: ${{ github.repository }} + PR NUMBER: ${{ github.event.issue.number }} You are reviewing a pull request to Quokka, a radiation magnetohydrodynamics code built on AMReX. Quokka uses C++20 with GPU support (CUDA/HIP) and a single codebase @@ -104,15 +80,9 @@ jobs: - Test variants (same binary, different `.toml`) are additional `add_test` entries in the same `CMakeLists.txt`, not separate executables. - ## Output - - Post an overall summary as a top-level PR comment. - - Use inline comments for specific line-level issues. - - Be constructive: explain why something is a problem and suggest a concrete fix. - - Do not speculate about runtime behaviour you cannot observe. + Provide detailed feedback using inline comments for specific issues. - use_sticky_comment: true - show_full_output: true + Post an overall summary as a top-level PR comment. claude_args: | - --model claude-opus-4-7 - --max-turns 30 + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 442910e96..87c604bf0 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -23,10 +23,10 @@ jobs: pull-requests: write issues: write id-token: write - actions: read + actions: read # Required for Claude to read CI results on PRs steps: - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4 + uses: actions/checkout@v6 with: fetch-depth: 1 @@ -36,8 +36,25 @@ jobs: with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} additional_permissions: | - actions: read - claude_args: | - --model claude-opus-4-7 - --max-turns 30 + actions: read # Required for viewing workflow results + # Optional: Customize the trigger phrase (default: @claude) + # trigger_phrase: "/claude" + + # Optional: Trigger when specific user is assigned to an issue + # assignee_trigger: "claude-bot" + + # Optional: Configure Claude's behavior with CLI arguments + # claude_args: | + # --model claude-opus-4-1-20250805 + # --max-turns 10 + # --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" + # --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files." + + # Optional: Advanced settings configuration + # settings: | + # { + # "env": { + # "NODE_ENV": "test" + # } + # } \ No newline at end of file