"Update Claude Code Review workflow"
This commit is contained in:
parent
f8fcffa4b6
commit
c22ef5a6e1
1 changed files with 10 additions and 41 deletions
51
.github/workflows/claude-code-review.yml
vendored
51
.github/workflows/claude-code-review.yml
vendored
|
|
@ -2,7 +2,7 @@ name: Claude Code Review
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize]
|
types: [opened, synchronize, ready_for_review, reopened]
|
||||||
# Optional: Only run on specific file changes
|
# Optional: Only run on specific file changes
|
||||||
# paths:
|
# paths:
|
||||||
# - "src/**/*.ts"
|
# - "src/**/*.ts"
|
||||||
|
|
@ -17,14 +17,14 @@ jobs:
|
||||||
# github.event.pull_request.user.login == 'external-contributor' ||
|
# github.event.pull_request.user.login == 'external-contributor' ||
|
||||||
# github.event.pull_request.user.login == 'new-developer' ||
|
# github.event.pull_request.user.login == 'new-developer' ||
|
||||||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: read
|
pull-requests: read
|
||||||
issues: read
|
issues: read
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -33,43 +33,12 @@ jobs:
|
||||||
|
|
||||||
- name: Run Claude Code Review
|
- name: Run Claude Code Review
|
||||||
id: claude-review
|
id: claude-review
|
||||||
uses: anthropics/claude-code-action@beta
|
uses: anthropics/claude-code-action@v1
|
||||||
with:
|
with:
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
|
||||||
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
|
plugins: 'code-review@claude-code-plugins'
|
||||||
# model: "claude-opus-4-20250514"
|
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
|
||||||
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
# Direct prompt for automated review (no @claude mention needed)
|
# or https://code.claude.com/docs/en/cli-reference for available options
|
||||||
direct_prompt: |
|
|
||||||
Please review this pull request and provide feedback on:
|
|
||||||
- Code quality and best practices
|
|
||||||
- Potential bugs or issues
|
|
||||||
- Performance considerations
|
|
||||||
- Security concerns
|
|
||||||
- Test coverage
|
|
||||||
|
|
||||||
Be constructive and helpful in your feedback.
|
|
||||||
|
|
||||||
# Optional: Customize review based on file types
|
|
||||||
# direct_prompt: |
|
|
||||||
# Review this PR focusing on:
|
|
||||||
# - For TypeScript files: Type safety and proper interface usage
|
|
||||||
# - For API endpoints: Security, input validation, and error handling
|
|
||||||
# - For React components: Performance, accessibility, and best practices
|
|
||||||
# - For tests: Coverage, edge cases, and test quality
|
|
||||||
|
|
||||||
# Optional: Different prompts for different authors
|
|
||||||
# direct_prompt: |
|
|
||||||
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
|
|
||||||
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
|
|
||||||
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
|
|
||||||
|
|
||||||
# Optional: Add specific tools for running tests or linting
|
|
||||||
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
|
|
||||||
|
|
||||||
# Optional: Skip review for certain conditions
|
|
||||||
# if: |
|
|
||||||
# !contains(github.event.pull_request.title, '[skip-review]') &&
|
|
||||||
# !contains(github.event.pull_request.title, '[WIP]')
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue