1212
1313jobs :
1414 claude-review :
15- # Optional: Filter by PR author
16- # if: |
17- # github.event.pull_request.user.login == 'external-contributor' ||
18- # github.event.pull_request.user.login == 'new-developer' ||
19- # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
15+ # Skip review for automated "Version Packages" PRs created by changesets
16+ if : github.event.pull_request.title != 'Version Packages'
2017
2118 runs-on : ubuntu-latest
2219 permissions :
@@ -37,21 +34,34 @@ jobs:
3734 with :
3835 anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
3936 prompt : |
40- REPO: ${{ github.repository }}
41- PR NUMBER: ${{ github.event.pull_request.number }}
37+ Review PR #${{ github.event.pull_request.number }}.
4238
43- Please review this pull request and provide feedback on:
44- - Code quality and best practices
45- - Potential bugs or issues
46- - Performance considerations
47- - Security concerns
48- - Test coverage
39+ Read CLAUDE.md for project conventions and architecture patterns. Focus on substantive issues:
40+ - Code quality, potential bugs, architecture alignment
41+ - Testing coverage
4942
50- Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
43+ BE CONCISE. Only report actual issues worth addressing - skip generic praise and obvious observations.
44+ If the PR looks good, just say so briefly.
5145
52- Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
46+ **Posting your review:**
47+ 1. First, check if you've already posted a review comment on this PR (find the comment ID):
48+ ```bash
49+ COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | select(.user.login == "claude[bot]" or .user.login == "github-actions[bot]") | select(.body | startswith("## Claude Code Review")) | .id' | head -1)
50+ ```
51+
52+ 2. If COMMENT_ID exists (non-empty), UPDATE that comment:
53+ ```bash
54+ gh api repos/${{ github.repository }}/issues/comments/$COMMENT_ID -X PATCH -f body="YOUR_REVIEW_CONTENT_HERE"
55+ ```
56+
57+ 3. If COMMENT_ID is empty, create a new comment:
58+ ```bash
59+ gh pr comment ${{ github.event.pull_request.number }} --body "YOUR_REVIEW_CONTENT_HERE" --repo ${{ github.repository }}
60+ ```
61+
62+ Start your review with "## Claude Code Review" heading so it can be identified and updated on subsequent runs.
5363
5464 # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5565 # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
56- claude_args : ' --allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
66+ claude_args : ' --allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh api:*) "'
5767
0 commit comments