Skip to content

Commit 38bead3

Browse files
authored
Merge pull request #593 from modelcontextprotocol/add-claude-github-actions-1752061634011
Add Claude Code GitHub Workflow
2 parents b2347db + 7667e56 commit 38bead3

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/claude.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(
17+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
19+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
20+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
21+
) &&
22+
(
23+
github.actor == 'ihrpr' ||
24+
github.actor == 'olaservo'
25+
)
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
pull-requests: read
30+
issues: read
31+
id-token: write
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 1
37+
38+
- name: Run Claude Code
39+
id: claude
40+
uses: anthropics/claude-code-action@beta
41+
with:
42+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
43+
44+
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
45+
# model: "claude-opus-4-20250514"
46+
47+
# Optional: Customize the trigger phrase (default: @claude)
48+
# trigger_phrase: "/claude"
49+
50+
# Optional: Trigger when specific user is assigned to an issue
51+
# assignee_trigger: "claude-bot"
52+
53+
# Optional: Allow Claude to run specific commands
54+
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
55+
56+
# Optional: Add custom instructions for Claude to customize its behavior for your project
57+
# custom_instructions: |
58+
# Follow our coding standards
59+
# Ensure all new code has tests
60+
# Use TypeScript for new files
61+
62+
# Optional: Custom environment variables for Claude
63+
# claude_env: |
64+
# NODE_ENV: test

0 commit comments

Comments
 (0)