Skip to content
Merged
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
68 changes: 68 additions & 0 deletions template/.github/workflows/claude.yaml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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: |
{% raw %}(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'))){% endraw %}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:

- name: Clone Repository
uses: actions/checkout@v4

- name: Prepare Python and Hatch
uses: ./.github/actions/python-hatch
with:
needs-clone: false
python-version: '3.10'

- name: Create CLAUDE.md symlink
run: |
if [ -f ".auxiliary/configuration/conventions.md" ]; then
ln -sf .auxiliary/configuration/conventions.md CLAUDE.md
echo "::notice::Created symlink: CLAUDE.md -> .auxiliary/configuration/conventions.md"
else
echo "::error file=.auxiliary/configuration/conventions.md::Required conventions file not found"
exit 1
fi
shell: bash

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: {% raw %}'${{ secrets.ANTHROPIC_API_KEY }}'{% endraw %}
trigger_phrase: "/claude"
timeout_minutes: 20
allowed_tools: |
Bash(hatch --env develop run linters)
Bash(hatch --env develop run testers)
Bash(hatch --env develop run docsgen)
Bash(hatch --env develop run packagers)
Bash(hatch run python:*)
Bash(git status)
Bash(git add:*)
Bash(git commit:*)
Bash(python:*)
Bash(pip:*)
Edit(**)
Write(**)