Skip to content

Commit 660d70d

Browse files
authored
feat: add Claude dispatch workflow for repository events (#198)
* feat: add Claude dispatch workflow for repository events - Add claude-dispatch.yml workflow for repository_dispatch events - Enables programmatic Claude Code task execution via API - Complements existing comment-based Claude integration - Supports configurable model selection and allowed tools * fix: update Claude dispatch workflow to match original gist exactly - Change trigger type from 'claude' to 'claude-dispatch' - Update action version from @beta to @eap - Add remote-agent mode configuration - Include anthropic_api_key option alongside existing oauth token - Add id-token write permission - Include fetch-depth: 1 for checkout - Add preliminary setup section - Update job name to 'claude-dispatch' - Add comprehensive documentation comments
1 parent 74b4a39 commit 660d70d

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# IMPORTANT: Do not move this file in your repo! Make sure it's located at .github/workflows/claude-dispatch.yml
2+
3+
name: Claude Code Dispatch
4+
5+
# IMPORTANT: Do not modify this `on` section!
6+
7+
on:
8+
repository_dispatch:
9+
types: [claude-dispatch]
10+
11+
jobs:
12+
claude-dispatch:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
issues: write
18+
id-token: write
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 1
24+
25+
# - name: Preliminary Setup
26+
# run: |
27+
# echo "Setting up environment..."
28+
# # Add any preliminary setup commands here to setup Claude's dev environment
29+
# # e.g., npm install, etc.
30+
31+
- name: Run Claude Code
32+
id: claude
33+
uses: anthropics/claude-code-action@eap
34+
with:
35+
mode: 'remote-agent'
36+
# Optional: Specify an API key, otherwise we'll use your Claude account automatically
37+
# anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
38+
39+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
40+
# model: "claude-opus-4-20250514"
41+
42+
# Optional: Allow Claude to run specific commands
43+
# allowed_tools: |
44+
# Bash(npm run lint)
45+
# Bash(npm run test)
46+
# Bash(npm run build)
47+
48+
# Optional: Custom environment variables for Claude
49+
# claude_env: |
50+
# NODE_ENV: test

0 commit comments

Comments
 (0)