Skip to content

Commit 1ed1c18

Browse files
centdixrubenfiszel
andauthored
internal: better claude review (#6130)
* better claude review * Update pr-ready-review.yml --------- Co-authored-by: Ruben Fiszel <[email protected]>
1 parent e3aee0c commit 1ed1c18

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

.github/workflows/pr-ready-review.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
1-
name: Auto Comment on PR Ready for Review
1+
name: Claude Auto Review
22

33
on:
44
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
610

711
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
1119
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
1427
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

Comments
 (0)