Skip to content

Commit d133a3a

Browse files
authored
ci(workflows): Add Claude workflows for PR reviews and issue comments (#3039)
1 parent e4a6062 commit d133a3a

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Auto review PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, ready_for_review]
6+
7+
jobs:
8+
auto-review:
9+
if: github.event.pull_request.draft == false
10+
permissions:
11+
contents: read
12+
id-token: write
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
20+
21+
- name: Auto review PR
22+
uses: anthropics/claude-code-action@beta
23+
with:
24+
direct_prompt: |
25+
Please review this PR. Look at the changes and provide thoughtful feedback on:
26+
- Code quality and best practices
27+
- Potential bugs or issues
28+
- Performance considerations
29+
- Security implications
30+
- Documentation updates if needed
31+
32+
Be constructive and specific in your feedback. Give inline comments where applicable.
33+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
34+
allowed_tools: "mcp__github__add_pull_request_review_comment"

.github/workflows/claude.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Claude Github Assistant
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(
17+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
19+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
20+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
21+
) && (github.event.pull_request.draft != true)
22+
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
pull-requests: read
27+
issues: read
28+
id-token: write
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 1
34+
35+
- name: Run Claude Github Assistant
36+
id: claude
37+
uses: anthropics/claude-code-action@beta
38+
with:
39+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

0 commit comments

Comments
 (0)