Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

Commit d739566

Browse files
Spacehunterzclaude
andcommitted
Fix auto-trigger with prompt parameter
Split into 3 jobs: - claude-issues: Auto-responds to new issues with prompt - claude-pr-review: Auto-reviews PRs with prompt - claude-mentions: Responds to @claude in comments Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 07653ab commit d739566

1 file changed

Lines changed: 56 additions & 27 deletions

File tree

.github/workflows/claude.yml

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,85 @@ on:
66
pull_request_review_comment:
77
types: [created]
88
issues:
9-
types: [opened, assigned]
9+
types: [opened]
1010
pull_request_review:
1111
types: [submitted]
1212
pull_request:
1313
types: [opened, synchronize]
1414

1515
jobs:
16-
claude:
17-
if: |
18-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
19-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
20-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
21-
(github.event_name == 'issues') ||
22-
(github.event_name == 'pull_request')
16+
# Auto-respond to new issues
17+
claude-issues:
18+
if: github.event_name == 'issues'
2319
runs-on: ubuntu-latest
2420
permissions:
2521
contents: write
2622
pull-requests: write
2723
issues: write
2824
id-token: write
29-
actions: read # Required for Claude to read CI results on PRs
25+
actions: read
3026
steps:
3127
- name: Checkout repository
3228
uses: actions/checkout@v5
3329
with:
3430
fetch-depth: 1
3531

3632
- name: Run Claude Code
37-
id: claude
3833
uses: anthropics/claude-code-action@v1
3934
with:
4035
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
36+
prompt: |
37+
Analyze this issue and implement a solution:
38+
1. Understand what is being requested
39+
2. Implement the necessary changes
40+
3. Create a pull request with your changes
4141
42-
# Optional: Customize the trigger phrase (default: @claude)
43-
# trigger_phrase: "/claude"
42+
# Auto-review new PRs
43+
claude-pr-review:
44+
if: github.event_name == 'pull_request'
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
pull-requests: write
49+
issues: write
50+
id-token: write
51+
actions: read
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v5
55+
with:
56+
fetch-depth: 1
4457

45-
# Optional: Trigger when specific user is assigned to an issue
46-
# assignee_trigger: "claude-bot"
58+
- name: Run Claude Code
59+
uses: anthropics/claude-code-action@v1
60+
with:
61+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
62+
prompt: |
63+
Review this pull request:
64+
1. Check the code changes for correctness
65+
2. Identify any issues or improvements
66+
3. Provide a summary review
4767
48-
# Optional: Configure Claude's behavior with CLI arguments
49-
# claude_args: |
50-
# --model claude-opus-4-1-20250805
51-
# --max-turns 10
52-
# --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
53-
# --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files."
68+
# Respond to @claude mentions in comments
69+
claude-mentions:
70+
if: |
71+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
72+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
73+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
74+
runs-on: ubuntu-latest
75+
permissions:
76+
contents: write
77+
pull-requests: write
78+
issues: write
79+
id-token: write
80+
actions: read
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v5
84+
with:
85+
fetch-depth: 1
5486

55-
# Optional: Advanced settings configuration
56-
# settings: |
57-
# {
58-
# "env": {
59-
# "NODE_ENV": "test"
60-
# }
61-
# }
87+
- name: Run Claude Code
88+
uses: anthropics/claude-code-action@v1
89+
with:
90+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

0 commit comments

Comments
 (0)