-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (38 loc) · 1.22 KB
/
code-review.yml
File metadata and controls
45 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Code review
on:
pull_request:
branches: ["main"]
types: [opened, synchronize, ready_for_review, reopened]
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
concurrency:
group: code-review-${{ github.ref }}
cancel-in-progress: true
jobs:
code-review:
# Skip drafts.
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run code review
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
allowed_bots: "claude[bot]"
prompt: |
Review PR #${{ github.event.pull_request.number }} in ${{ github.repository }}.
Get the diff: gh pr diff ${{ github.event.pull_request.number }}
Read and follow the instructions in .github/prompts/code-review.md
claude_args: >-
--allowedTools Read,Glob,Grep,Skill,Task,Bash(gh:*),mcp__github_inline_comment__*
env:
# Required by gh CLI to fetch PR diffs and post review comments.
GH_TOKEN: ${{ github.token }}