Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize] # Runs on new PRs and updates

jobs:
code-review:
runs-on: ubuntu-latest
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:
# Define the review focus areas
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 }}
48 changes: 48 additions & 0 deletions .github/workflows/claude-comment-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Claude Comment Response
on:
issue_comment:
types: [created] # Triggers when someone comments on an issue or PR

jobs:
respond-to-claude-mention:
# Only run if the comment mentions @claude
if: contains(github.event.comment.body, '@claude')
runs-on: ubuntu-latest
steps:
- uses: anthropics/claude-code-action@beta
with:
# Pass the comment text as the prompt
prompt: "${{ github.event.comment.body }}"

# Define which tools Claude can use
allowed_tools: [
# Git inspection commands (read-only)
"Bash(git status)",
"Bash(git log)",
"Bash(git show)",
"Bash(git blame)",
"Bash(git ls-files)",
"Bash(git branch)",
"Bash(git tag)",
"Bash(git diff)",

# File modifications
"Bash(git add)",
"Bash(git commit)",

# File exploration tools
"View", # Read file contents
"Edit", # Edit files
"GlobTool", # Find files by pattern
"GrepTool", # Search file contents
"BatchTool" # Run multiple tools in parallel
]

# Maximum number of conversation turns
max_turns: 10

# Timeout after 20 minutes
timeout_minutes: 20

# Your Anthropic API key (stored as a GitHub secret)
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
64 changes: 64 additions & 0 deletions .github/workflows/claude-pr-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Claude PR Creation

on:
issue_comment:
types: [created] # Triggers when someone comments on an issue

jobs:
create-pr:
# Only run if the comment mentions @claude create pr or similar
if: >
contains(github.event.comment.body, '@claude create pr') ||
contains(github.event.comment.body, '@claude create a pr') ||
contains(github.event.comment.body, '@claude implement') ||
contains(github.event.comment.body, '@claude fix')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: anthropics/claude-code-action@beta
with:
# Pass the comment text as the prompt
prompt: "${{ github.event.comment.body }}"

# Define which tools Claude can use
allowed_tools: [
# Git inspection commands
"Bash(git status)",
"Bash(git log)",
"Bash(git show)",
"Bash(git blame)",
"Bash(git reflog)",
"Bash(git stash list)",
"Bash(git ls-files)",
"Bash(git branch)",
"Bash(git tag)",
"Bash(git diff)",

# Git modification commands
"Bash(git checkout -b)",
"Bash(git add)",
"Bash(git commit)",
"Bash(git push)",

# GitHub CLI commands for PR creation
"Bash(gh pr create)",

# File exploration and modification tools
"View", # Read file contents
"Edit", # Edit files
"GlobTool", # Find files by pattern
"GrepTool", # Search file contents
"BatchTool" # Run multiple tools in parallel
]

# Maximum number of conversation turns
max_turns: 20

# Timeout after 30 minutes for potentially complex implementations
timeout_minutes: 30

# Your Anthropic API key (stored as a GitHub secret)
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
Loading
Loading