forked from MultiQC/MultiQC
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (62 loc) · 2.42 KB
/
Copy pathclaude-code-review.yml
File metadata and controls
73 lines (62 loc) · 2.42 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Claude Code Review
on:
workflow_run:
workflows: ["Claude Code Review Trigger"]
types:
- completed
jobs:
claude-review:
# Only run if the trigger workflow succeeded
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- name: Download PR info
uses: actions/download-artifact@v4
with:
name: pr-info
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: Get PR number
id: pr-info
run: |
ls -la
PR_NUMBER=$(cat pr-number.txt)
HEAD_SHA=$(cat head-sha.txt)
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
echo "head_sha=$HEAD_SHA" >> $GITHUB_OUTPUT
echo "PR Number: $PR_NUMBER"
echo "Head SHA: $HEAD_SHA"
- name: Checkout PR
uses: actions/checkout@v4
with:
ref: ${{ steps.pr-info.outputs.head_sha }}
fetch-depth: 0
- name: Run Claude Code Review
id: claude-review
timeout-minutes: 15
uses: anthropics/claude-code-action@v1
env:
PR_NUMBER: ${{ steps.pr-info.outputs.pr_number }}
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
show_full_output: true
prompt: |
Please review pull request #${{ steps.pr-info.outputs.pr_number }} and provide feedback on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage
Write a very brief summary at the top, then include the rest of your review within a <details></details> HTML tag.
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
IMPORTANT: Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR. You MUST post the comment - do not just display it.
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
claude_args: |
--permission-mode bypassPermissions
--allowed-tools "Bash(gh:*) Read Glob Grep"