mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-22 22:44:13 +08:00
- Reviews PR using embedded GitHub Actions variables - Fetches PR details and diff using gh CLI - Posts review as comment using gh pr comment - Designed for use in automated workflows
1.4 KiB
1.4 KiB
allowed-tools, description
| allowed-tools | description |
|---|---|
| Bash(gh pr view:*), Bash(gh pr diff:*), Bash(gh pr comment:*), Bash(gh api:*), Read, Glob, Grep | Review the current PR in GitHub Actions |
Review PR #${{ github.event.pull_request.number }} and post a comment with your findings.
Steps
-
Get the PR details to understand context:
gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json title,body,author,state,isDraft,files,baseRefName,headRefName -
Get the diff to see what changed:
gh pr diff ${{ github.event.pull_request.number }} --repo ${{ github.repository }} -
Review the changes focusing on:
- Code quality and best practices
- Potential bugs or security issues
- Performance concerns
- Missing tests or documentation
- Consistency with existing codebase
-
Write your review to a file, then post it:
cat > /tmp/pr-review.md << 'EOF' ## Code Review [Your review here - be specific and constructive] 🤖 Generated with [Claude Code](https://claude.ai/code) EOF gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body-file /tmp/pr-review.md
Important
- Be constructive and specific
- Reference specific files and line numbers when pointing out issues
- Acknowledge what's done well
- Provide actionable suggestions for improvements