Skip to content

lesss go

lesss go #7

name: Claude Code Review
on:
pull_request:
types: [opened, synchronize] # Runs on new PRs and updates
jobs:
code-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
# Check out the code to allow git diff operations
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for accurate diffs
- name: Run Code Review with Claude
id: code-review
uses: anthropics/claude-code-action@beta
with:
# Your GitHub token for API operations
github_token: ${{ secrets.GITHUB_TOKEN }}
# Define the review focus areas
direct_prompt: "Review the PR changes. Focus on code quality, potential bugs, and performance issues. Suggest improvements where appropriate. Pay special attention to Kubernetes operator patterns and Go best practices according to the CLAUDE.md file."
# Limited tools for safer review operations
allowed_tools: |-
# Git inspection commands (read-only)
Bash(git status)
Bash(git log)
Bash(git diff --name-only HEAD~1)
Bash(git diff HEAD~1)
Bash(git show)
Bash(git blame)
# File exploration tools
View # Read file contents
GlobTool # Find files by pattern
GrepTool # Search file contents
BatchTool # Run multiple tools in parallel
# Timeout after 15 minutes
timeout_minutes: 15
# Your Anthropic API key (stored as a GitHub secret)
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}