Skip to content

wip bug squashing

wip bug squashing #2

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:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for accurate diffs
- name: Claude PR Creation
uses: anthropics/claude-code-action@beta
with:
# Your GitHub token for API operations
github_token: ${{ secrets.GITHUB_TOKEN }}
# Pass the comment text as the prompt
direct_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 }}