@@ -2,7 +2,7 @@ name: Claude Code Review
22
33on :
44 pull_request :
5- types : [opened, synchronize, labeled, unlabeled ]
5+ types : [opened, synchronize]
66 # Optional: Only run on specific file changes
77 # paths:
88 # - "src/**/*.ts"
1212
1313jobs :
1414 claude-review :
15- if : |
16- contains(github.event.pull_request.labels.*.name, 'claude')
15+ # Optional: Filter by PR author
16+ # if: |
1717 # github.event.pull_request.user.login == 'external-contributor' ||
1818 # github.event.pull_request.user.login == 'new-developer' ||
1919 # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
@@ -27,48 +27,28 @@ jobs:
2727
2828 steps :
2929 - name : Checkout repository
30- uses : actions/checkout@v5
30+ uses : actions/checkout@v4
3131 with :
3232 fetch-depth : 1
3333
3434 - name : Run Claude Code Review
3535 id : claude-review
36- uses : anthropics/claude-code-action@beta
36+ uses : anthropics/claude-code-action@v1
3737 with :
38- anthropic_api_key : ${{ secrets.ANTHROPIC_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 : |
38+ claude_code_oauth_token : ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+ prompt : |
4540 Please review this pull request and provide feedback on:
4641 - Code quality and best practices
4742 - Potential bugs or issues
4843 - Performance considerations
4944 - Security concerns
5045 - Test coverage
5146
52- Be constructive and helpful in your feedback.
53-
54- # Optional: Customize review based on file types
55- # direct_prompt: |
56- # Review this PR focusing on:
57- # - For TypeScript files: Type safety and proper interface usage
58- # - For API endpoints: Security, input validation, and error handling
59- # - For React components: Performance, accessibility, and best practices
60- # - For tests: Coverage, edge cases, and test quality
61-
62- # Optional: Different prompts for different authors
63- # direct_prompt: |
64- # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
65- # 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
66- # 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
67-
68- # Optional: Add specific tools for running tests or linting
69- # allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
47+ Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
48+
49+ Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
7050
71- # Optional: Skip review for certain conditions
72- # if: |
73- # !contains(github.event.pull_request.title, '[skip-review]') &&
74- # !contains(github.event.pull_request.title, '[WIP]')
51+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
52+ # or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
53+ claude_args : ' --allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)" '
54+
0 commit comments