|
| 1 | +name: Claude Code Review |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize] |
| 6 | + branches: [main] |
| 7 | + issue_comment: |
| 8 | + types: [created] |
| 9 | + pull_request_review_comment: |
| 10 | + types: [created] |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + pull-requests: write |
| 15 | + issues: write |
| 16 | + |
| 17 | +jobs: |
| 18 | + auto-review: |
| 19 | + if: github.event_name == 'pull_request' |
| 20 | + runs-on: ubuntu-latest |
| 21 | + timeout-minutes: 10 |
| 22 | + concurrency: |
| 23 | + group: claude-review-${{ github.event.pull_request.number }} |
| 24 | + cancel-in-progress: true |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + fetch-depth: 0 |
| 29 | + |
| 30 | + - uses: anthropics/claude-code-action@v1 |
| 31 | + env: |
| 32 | + ANTHROPIC_BASE_URL: https://api.minimax.io/anthropic |
| 33 | + with: |
| 34 | + anthropic_api_key: ${{ secrets.MINIMAX_API_KEY }} |
| 35 | + prompt: | |
| 36 | + Review this pull request. Focus on: |
| 37 | + 1. Code correctness and potential bugs |
| 38 | + 2. TypeScript type safety |
| 39 | + 3. React best practices and performance |
| 40 | + 4. Security concerns |
| 41 | + 5. Code style consistency |
| 42 | +
|
| 43 | + Be concise and actionable. Only comment on meaningful issues, not style nitpicks already covered by linters. |
| 44 | + claude_args: "--model MiniMax-M2.5 --max-turns 3" |
| 45 | + |
| 46 | + interactive: |
| 47 | + if: | |
| 48 | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
| 49 | + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) |
| 50 | + runs-on: ubuntu-latest |
| 51 | + timeout-minutes: 15 |
| 52 | + concurrency: |
| 53 | + group: claude-interactive-${{ github.event.issue.number || github.event.pull_request.number }}-${{ github.event.comment.id }} |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + fetch-depth: 0 |
| 58 | + |
| 59 | + - uses: anthropics/claude-code-action@v1 |
| 60 | + env: |
| 61 | + ANTHROPIC_BASE_URL: https://api.minimax.io/anthropic |
| 62 | + with: |
| 63 | + anthropic_api_key: ${{ secrets.MINIMAX_API_KEY }} |
| 64 | + claude_args: "--model MiniMax-M2.5 --max-turns 10" |
0 commit comments