···2233on:
44 pull_request:
55- types: [opened, synchronize]
55+ types: [opened, synchronize, ready_for_review, reopened]
66 # Optional: Only run on specific file changes
77 # paths:
88 # - "src/**/*.ts"
···1717 # github.event.pull_request.user.login == 'external-contributor' ||
1818 # github.event.pull_request.user.login == 'new-developer' ||
1919 # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
2020-2020+2121 runs-on: ubuntu-latest
2222 permissions:
2323 contents: read
2424 pull-requests: read
2525 issues: read
2626 id-token: write
2727-2727+2828 steps:
2929 - name: Checkout repository
3030 uses: actions/checkout@v4
···33333434 - name: Run Claude Code Review
3535 id: claude-review
3636- uses: anthropics/claude-code-action@beta
3636+ uses: anthropics/claude-code-action@v1
3737 with:
3838 claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3939-4040- # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
4141- # model: "claude-opus-4-20250514"
4242-4343- # Direct prompt for automated review (no @claude mention needed)
4444- direct_prompt: |
4545- Please review this pull request and provide feedback on:
4646- - Code quality and best practices
4747- - Potential bugs or issues
4848- - Performance considerations
4949- - Security concerns
5050- - Test coverage
5151-5252- Be constructive and helpful in your feedback.
5353-5454- # Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
5555- # use_sticky_comment: true
5656-5757- # Optional: Customize review based on file types
5858- # direct_prompt: |
5959- # Review this PR focusing on:
6060- # - For TypeScript files: Type safety and proper interface usage
6161- # - For API endpoints: Security, input validation, and error handling
6262- # - For React components: Performance, accessibility, and best practices
6363- # - For tests: Coverage, edge cases, and test quality
6464-6565- # Optional: Different prompts for different authors
6666- # direct_prompt: |
6767- # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
6868- # 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
6969- # 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
7070-7171- # Optional: Add specific tools for running tests or linting
7272- # allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
7373-7474- # Optional: Skip review for certain conditions
7575- # if: |
7676- # !contains(github.event.pull_request.title, '[skip-review]') &&
7777- # !contains(github.event.pull_request.title, '[WIP]')
3939+ plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
4040+ plugins: 'code-review@claude-code-plugins'
4141+ prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
4242+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4343+ # or https://code.claude.com/docs/en/cli-reference for available options
7844
+15-2
.github/workflows/claude.yml
···2323 pull-requests: read
2424 issues: read
2525 id-token: write
2626- actions: read
2626+ actions: read # Required for Claude to read CI results on PRs
2727 steps:
2828 - name: Checkout repository
2929- uses: actions/checkout@v6
2929+ uses: actions/checkout@v4
3030 with:
3131 fetch-depth: 1
3232···3535 uses: anthropics/claude-code-action@v1
3636 with:
3737 claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3838+3939+ # This is an optional setting that allows Claude to read CI results on PRs
4040+ additional_permissions: |
4141+ actions: read
4242+4343+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
4444+ # prompt: 'Update the pull request description to include a summary of changes.'
4545+4646+ # Optional: Add claude_args to customize behavior and configuration
4747+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4848+ # or https://code.claude.com/docs/en/cli-reference for available options
4949+ # claude_args: '--allowed-tools Bash(gh pr:*)'
5050+