|
6 | 6 | pull_request_review_comment: |
7 | 7 | types: [created] |
8 | 8 | issues: |
9 | | - types: [opened, assigned] |
| 9 | + types: [opened] |
10 | 10 | pull_request_review: |
11 | 11 | types: [submitted] |
12 | 12 | pull_request: |
13 | 13 | types: [opened, synchronize] |
14 | 14 |
|
15 | 15 | 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') || |
22 | | - (github.event_name == 'pull_request') |
| 16 | + # Auto-respond to new issues |
| 17 | + claude-issues: |
| 18 | + if: github.event_name == 'issues' |
23 | 19 | runs-on: ubuntu-latest |
24 | 20 | permissions: |
25 | 21 | contents: write |
26 | 22 | pull-requests: write |
27 | 23 | issues: write |
28 | 24 | id-token: write |
29 | | - actions: read # Required for Claude to read CI results on PRs |
| 25 | + actions: read |
30 | 26 | steps: |
31 | 27 | - name: Checkout repository |
32 | 28 | uses: actions/checkout@v5 |
33 | 29 | with: |
34 | 30 | fetch-depth: 1 |
35 | 31 |
|
36 | 32 | - name: Run Claude Code |
37 | | - id: claude |
38 | 33 | uses: anthropics/claude-code-action@v1 |
39 | 34 | with: |
40 | 35 | claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
| 36 | + prompt: | |
| 37 | + Analyze this issue and implement a solution: |
| 38 | + 1. Understand what is being requested |
| 39 | + 2. Implement the necessary changes |
| 40 | + 3. Create a pull request with your changes |
41 | 41 |
|
42 | | - # Optional: Customize the trigger phrase (default: @claude) |
43 | | - # trigger_phrase: "/claude" |
| 42 | + # Auto-review new PRs |
| 43 | + claude-pr-review: |
| 44 | + if: github.event_name == 'pull_request' |
| 45 | + runs-on: ubuntu-latest |
| 46 | + permissions: |
| 47 | + contents: write |
| 48 | + pull-requests: write |
| 49 | + issues: write |
| 50 | + id-token: write |
| 51 | + actions: read |
| 52 | + steps: |
| 53 | + - name: Checkout repository |
| 54 | + uses: actions/checkout@v5 |
| 55 | + with: |
| 56 | + fetch-depth: 1 |
44 | 57 |
|
45 | | - # Optional: Trigger when specific user is assigned to an issue |
46 | | - # assignee_trigger: "claude-bot" |
| 58 | + - name: Run Claude Code |
| 59 | + uses: anthropics/claude-code-action@v1 |
| 60 | + with: |
| 61 | + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
| 62 | + prompt: | |
| 63 | + Review this pull request: |
| 64 | + 1. Check the code changes for correctness |
| 65 | + 2. Identify any issues or improvements |
| 66 | + 3. Provide a summary review |
47 | 67 |
|
48 | | - # Optional: Configure Claude's behavior with CLI arguments |
49 | | - # claude_args: | |
50 | | - # --model claude-opus-4-1-20250805 |
51 | | - # --max-turns 10 |
52 | | - # --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" |
53 | | - # --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files." |
| 68 | + # Respond to @claude mentions in comments |
| 69 | + claude-mentions: |
| 70 | + if: | |
| 71 | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
| 72 | + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || |
| 73 | + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) |
| 74 | + runs-on: ubuntu-latest |
| 75 | + permissions: |
| 76 | + contents: write |
| 77 | + pull-requests: write |
| 78 | + issues: write |
| 79 | + id-token: write |
| 80 | + actions: read |
| 81 | + steps: |
| 82 | + - name: Checkout repository |
| 83 | + uses: actions/checkout@v5 |
| 84 | + with: |
| 85 | + fetch-depth: 1 |
54 | 86 |
|
55 | | - # Optional: Advanced settings configuration |
56 | | - # settings: | |
57 | | - # { |
58 | | - # "env": { |
59 | | - # "NODE_ENV": "test" |
60 | | - # } |
61 | | - # } |
| 87 | + - name: Run Claude Code |
| 88 | + uses: anthropics/claude-code-action@v1 |
| 89 | + with: |
| 90 | + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
0 commit comments