Skip to content

Commit 9826e82

Browse files
authored
Merge branch 'dev' into patch-1
2 parents d15c7d5 + c6af387 commit 9826e82

File tree

2 files changed

+101
-5
lines changed

2 files changed

+101
-5
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@beta
37+
with:
38+
anthropic_api_key: ${{ secrets.CLAUDE_CODE_API_KEY }}
39+
40+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
41+
# model: "claude-opus-4-20250514"
42+
43+
# Direct prompt for automated review (no @claude mention needed)
44+
direct_prompt: |
45+
This is a monorepo with multiple different services.
46+
The repo uses AGENTS.md as the file that contains instructions for
47+
AI agents (instead of CLAUDE.md files). CLAUDE.md still exists but is just a symlink to the corresponding AGENTS.md (usually in the same dir).
48+
49+
Please review this pull request and provide feedback on:
50+
- Code quality and best practices
51+
- Potential bugs or issues
52+
- Performance considerations
53+
- Security concerns
54+
- Test coverage
55+
56+
Be constructive and helpful in your feedback.
57+
58+
# Optional: Customize review based on file types
59+
# direct_prompt: |
60+
# Review this PR focusing on:
61+
# - For TypeScript files: Type safety and proper interface usage
62+
# - For API endpoints: Security, input validation, and error handling
63+
# - For React components: Performance, accessibility, and best practices
64+
# - For tests: Coverage, edge cases, and test quality
65+
66+
# Optional: Different prompts for different authors
67+
# direct_prompt: |
68+
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
69+
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
70+
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
71+
72+
# Optional: Add specific tools for running tests or linting
73+
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
74+
75+
# Optional: Skip review for certain conditions
76+
# if: |
77+
# !contains(github.event.pull_request.title, '[skip-review]') &&
78+
# !contains(github.event.pull_request.title, '[WIP]')
79+

.github/workflows/claude.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
2020
runs-on: ubuntu-latest
2121
permissions:
22-
contents: write
23-
pull-requests: write
24-
issues: write
22+
contents: read
23+
pull-requests: read
24+
issues: read
2525
id-token: write
2626
steps:
2727
- name: Checkout repository
@@ -33,11 +33,28 @@ jobs:
3333
id: claude
3434
uses: anthropics/claude-code-action@beta
3535
with:
36-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
37-
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
anthropic_api_key: ${{ secrets.CLAUDE_CODE_API_KEY }}
37+
38+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
39+
model: "claude-opus-4-20250514"
40+
41+
# Optional: Customize the trigger phrase (default: @claude)
42+
# trigger_phrase: "/claude"
43+
44+
# Optional: Trigger when specific user is assigned to an issue
45+
# assignee_trigger: "claude-bot"
46+
47+
# Optional: Allow Claude to run specific commands
48+
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
49+
50+
# Optional: Add custom instructions for Claude to customize its behavior for your project
3851
custom_instructions: >-
3952
This is a monorepo with multiple different services.
4053
The repo uses AGENTS.md as the file that contains instructions for
4154
AI agents (instead of CLAUDE.md files). CLAUDE.md still exists but
4255
is just a symlink to the corresponding AGENTS.md (usually in the same dir).
56+
57+
# Optional: Custom environment variables for Claude
58+
# claude_env: |
59+
# NODE_ENV: test
4360

0 commit comments

Comments
 (0)