claude.yml•2.45 kB
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Auto-invoke github-release-manager agent for bug fixes and features
# This triggers release workflow when Claude fixes issues on GitHub
prompt: |
${{ github.event.comment.body || github.event.issue.body || github.event.review.body }}
IMPORTANT: After completing the requested task, if you:
1. Fixed a bug (modified src/ code)
2. Added a new feature (modified src/ code)
3. Made any changes to pyproject.toml dependencies
Then automatically invoke the github-release-manager agent to:
- Determine appropriate version bump (patch for fixes, minor for features)
- Create release branch with version updates
- The Claude Branch Automation workflow will handle the rest
Skip release manager if you only changed:
- Documentation (.md files, docs/)
- Tests only (tests/ without src/ changes)
- CI/CD workflows (.github/)
- Development tools (.claude/)
Use your judgment - if unsure whether to release, ask the user.