|
1 |
| -name: Auto Comment on PR Ready for Review |
| 1 | +name: Claude Auto Review |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | pull_request:
|
5 |
| - types: [opened, ready_for_review] |
| 5 | + types: [ready_for_review, opened] |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: claude-review-${{ github.event.pull_request.number }} |
| 9 | + cancel-in-progress: true |
6 | 10 |
|
7 | 11 | jobs:
|
8 |
| - add-review-comment: |
9 |
| - if: github.event.pull_request.draft == false |
10 |
| - runs-on: ubicloud-standard-2 |
| 12 | + auto-review: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + if: github.event.pull_request.draft == false || github.event.pull_request.ready_for_review == true |
| 15 | + permissions: |
| 16 | + contents: read |
| 17 | + pull-requests: read |
| 18 | + id-token: write |
11 | 19 | steps:
|
12 |
| - - name: Add review comment |
13 |
| - uses: actions/github-script@v7 |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + fetch-depth: 1 |
| 24 | + |
| 25 | + - name: Automatic PR Review |
| 26 | + uses: anthropics/claude-code-action@beta |
14 | 27 | with:
|
15 |
| - github-token: ${{ secrets.PUBLIC_REPO_TOKEN }} |
16 |
| - script: | |
17 |
| - await github.rest.issues.createComment({ |
18 |
| - owner: context.repo.owner, |
19 |
| - repo: context.repo.repo, |
20 |
| - issue_number: context.payload.pull_request.number, |
21 |
| - body: '/ai review this PR' |
22 |
| - }); |
| 28 | + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
| 29 | + timeout_minutes: "60" |
| 30 | + direct_prompt: | |
| 31 | + Please review this pull request and provide comprehensive feedback. |
| 32 | +
|
| 33 | + Focus on: |
| 34 | + - Code quality and best practices |
| 35 | + - Potential bugs or issues |
| 36 | + - Performance considerations |
| 37 | + - Security implications |
| 38 | +
|
| 39 | + Provide constructive feedback with specific suggestions for improvement. |
| 40 | + Use inline comments to highlight specific areas of concern. |
| 41 | + allowed_tools: "mcp__github__create_pending_pull_request_review,mcp__github__add_pull_request_review_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff" |
0 commit comments