|
1 | | -name: Claude Code |
| 1 | +name: Claude Code Review |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | issue_comment: |
5 | 5 | types: [created] |
6 | 6 | pull_request_review_comment: |
7 | 7 | types: [created] |
8 | | - issues: |
9 | | - types: [opened, assigned] |
10 | | - pull_request_review: |
11 | | - types: [submitted] |
12 | 8 | pull_request: |
13 | 9 | types: [opened, synchronize] |
14 | 10 |
|
15 | 11 | jobs: |
16 | | - claude: |
17 | | - if: | |
18 | | - (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
19 | | - (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || |
20 | | - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || |
21 | | - (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) || |
22 | | - (github.event_name == 'pull_request') |
| 12 | + review: |
| 13 | + if: github.event_name == 'pull_request' |
23 | 14 | runs-on: ubuntu-latest |
24 | 15 | permissions: |
25 | | - contents: read |
26 | | - pull-requests: read |
27 | | - issues: read |
| 16 | + contents: write |
| 17 | + pull-requests: write |
| 18 | + issues: write |
28 | 19 | id-token: write |
29 | | - actions: read # Required for Claude to read CI results on PRs |
30 | 20 | steps: |
31 | 21 | - name: Checkout repository |
32 | 22 | uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 |
33 | | - with: |
34 | | - fetch-depth: 1 |
35 | | - - name: Run Claude Code |
36 | | - id: claude |
| 23 | + |
| 24 | + - name: Run Claude Auto Review |
37 | 25 | uses: anthropics/claude-code-action@ac1a3207f3f00b4a37e2f3a6f0935733c7c64651 # v1.0 |
38 | 26 | with: |
39 | 27 | anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
| 28 | + prompt: "/review" |
| 29 | + claude_args: | |
| 30 | + --system-prompt "Follow the guidelines in CLAUDE.md. Focus on code quality, security, TypeScript strict mode (NO any types), Next.js App Router best practices, and hey-api integration patterns." |
| 31 | + --max-turns 50 |
40 | 32 |
|
41 | | - # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it. |
42 | | - prompt: | |
43 | | - Review this PR following the guidelines in CLAUDE.md. |
44 | | - Focus on code quality, security, and adherence to project standards. |
45 | | - Be concise and actionable in your feedback - highlight critical issues first. |
| 33 | + # Respond to @claude mentions |
| 34 | + interactive: |
| 35 | + if: | |
| 36 | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
| 37 | + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) |
| 38 | + runs-on: ubuntu-latest |
| 39 | + permissions: |
| 40 | + contents: write |
| 41 | + pull-requests: write |
| 42 | + issues: write |
| 43 | + id-token: write |
| 44 | + steps: |
| 45 | + - name: Checkout repository |
| 46 | + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 |
46 | 47 |
|
47 | | - # Optional: Add claude_args to customize behavior and configuration |
48 | | - # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md |
49 | | - # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options |
50 | | - # claude_args: '--allowed-tools Bash(gh pr:*)' |
| 48 | + - name: Run Claude Interactive |
| 49 | + uses: anthropics/claude-code-action@ac1a3207f3f00b4a37e2f3a6f0935733c7c64651 # v1.0 |
| 50 | + with: |
| 51 | + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
| 52 | + claude_args: | |
| 53 | + --system-prompt "Follow the guidelines in CLAUDE.md. Focus on code quality, security, TypeScript strict mode (NO any types), Next.js App Router best practices, and hey-api integration patterns." |
| 54 | + --max-turns 50 |
0 commit comments