Add Claude Code GitHub Workflow #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 Code Review | |
on: | |
pull_request: | |
types: [opened, synchronize] # Runs on new PRs and updates | |
permissions: | |
contents: read | |
jobs: | |
code-review: | |
runs-on: ubuntu-latest | |
steps: | |
# Check out the code to allow git diff operations | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
fetch-depth: 0 # Fetch full history for accurate diffs | |
persist-credentials: false | |
- name: Run Code Review with Claude | |
id: code-review | |
uses: anthropics/claude-code-action@8e84799f37d42f24e0ebae41205346879bdcab5a # v0.0.7 | |
with: | |
# Define the review focus areas | |
prompt: "Review the PR changes. Focus on code quality, potential bugs, and performance issues. Suggest improvements where appropriate." | |
# Limited tools for safer review operations | |
allowed_tools: >- | |
[ | |
"Bash(git diff --name-only HEAD~1)", | |
"Bash(git diff HEAD~1)", | |
"View", | |
"GlobTool", | |
"GrepTool" | |
] | |
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |