Allow Claude to safely do code review automatically and from forks. Doesn't change the existing Claude workflow.
* Added claude_pr_review.yml
This commit is contained in:
parent
fe393e514a
commit
33b71992e4
1 changed files with 46 additions and 0 deletions
46
.github/workflows/claude_pr_review.yml
vendored
Normal file
46
.github/workflows/claude_pr_review.yml
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
name: Claude Code Review
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
claude-review:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout PR branch from fork
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.ref }}
|
||||||
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Run Claude Code Review
|
||||||
|
id: claude-review
|
||||||
|
uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
instructions: |
|
||||||
|
Please review this PR focusing on:
|
||||||
|
- TypeScript type safety
|
||||||
|
- MCP protocol compliance
|
||||||
|
- Security vulnerabilities
|
||||||
|
- Performance implications
|
||||||
|
|
||||||
|
- name: Comment on failure
|
||||||
|
if: failure()
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: '❌ Claude Code review failed. Please check the [action logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.'
|
||||||
|
})
|
||||||
Loading…
Reference in a new issue