Modify as per anthropic's instructions #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claude PR Comment Review | ||
|
Check failure on line 1 in .github/workflows/claude.yml
|
||
| # https://github.com/anthropics/claude-code-action/blob/main/docs/solutions.md#automatic-pr-code-review | ||
| # https://skywork.ai/blog/how-to-use-claude-code-for-prs-code-reviews-guide/#step-3-add-a-comment-triggered-workflow-copy-pasteable | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| jobs: | ||
| review: | ||
| if: >- | ||
| ${ | ||
| { contains(github.event.comment.body, '@claude') | ||
| && (github.event.issue.pull_request != null || github.event.pull_request != null) } | ||
| } | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 1 | ||
| - uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| track_progress: true # ✨ Enables tracking comments | ||
| prompt: | | ||
| REPO: ${{ github.repository }} | ||
| PR NUMBER: ${{ github.event.pull_request.number }} | ||
| Please review this pull request checked out in the current working directory with a focus on: | ||
| - Code quality and best practices | ||
| - Potential bugs or issues | ||
| - Security implications | ||
| - Performance considerations | ||
| Make sure to: | ||
| - Use `gh pr comment` for top-level feedback. | ||
| - Use `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues. | ||
| - Check consistency with existing code style | ||
| - Search the repository for code that could be reused in this PR | ||
| - Skip style issues already handled by linters. | ||
| - Respond in concise bullet point form; avoid restating code. | ||
| claude_args: | | ||
| --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" | ||