Skip to content

Commit ac1713b

Browse files
feat!: migrate to claude-code-action@v1 GA (v2.0.0)
Upgrades from @beta to @v1 GA (v1.0.71). Breaking changes for consumers: - direct_prompt renamed to prompt - allowed_tools (multiline) replaced by claude_args CLI format - Reusable workflow ref: @v1.0.0 -> @v2.0.0 New: use_sticky_comment and track_progress enabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d24c57b commit ac1713b

7 files changed

Lines changed: 136 additions & 95 deletions

File tree

.github/workflows/claude-executor.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# ROLE:
1212
# - Sets up the execution environment (permissions, timeouts, runner)
13-
# - Configures the anthropics/claude-code-action with configurable allowed tools
13+
# - Configures the anthropics/claude-code-action with configurable claude_args
1414
# - Handles the actual Claude AI interaction
1515
# - Provides a single source of truth for Claude execution configuration
1616
#
@@ -26,18 +26,16 @@ on:
2626
description: 'Mode of trigger - interactive or automatic'
2727
required: true
2828
type: string
29-
direct_prompt:
29+
prompt:
3030
description: 'Direct prompt for automatic reviews'
3131
required: false
3232
type: string
3333
default: ''
34-
allowed_tools:
35-
description: 'Custom allowed tools configuration'
34+
claude_args:
35+
description: 'Claude CLI arguments (e.g. --allowedTools "Bash(git status),Bash(git diff)")'
3636
required: false
3737
type: string
38-
default: |
39-
Bash(git status)
40-
Bash(git diff)
38+
default: '--allowedTools "Bash(git status),Bash(git diff)"'
4139
timeout_minutes:
4240
description: 'Timeout in minutes for the Claude execution'
4341
required: false
@@ -70,8 +68,10 @@ jobs:
7068

7169
- name: Run Claude Code
7270
id: claude
73-
uses: anthropics/claude-code-action@beta
71+
uses: anthropics/claude-code-action@v1
7472
with:
7573
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
76-
direct_prompt: ${{ inputs.direct_prompt }}
77-
allowed_tools: ${{ inputs.allowed_tools }}
74+
prompt: ${{ inputs.prompt }}
75+
claude_args: ${{ inputs.claude_args }}
76+
use_sticky_comment: "true"
77+
track_progress: "true"

.github/workflows/claude-orchestrator.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ on:
2424
description: 'Trigger mode: interactive or automatic'
2525
required: true
2626
type: string
27-
direct_prompt:
27+
prompt:
2828
description: 'Direct prompt for automatic mode'
2929
required: false
3030
type: string
31-
allowed_tools:
32-
description: 'Allowed tools configuration'
31+
claude_args:
32+
description: 'Claude CLI arguments (e.g. --allowedTools "Bash(git status),Bash(git diff)")'
3333
required: false
3434
type: string
35-
default: |
36-
Bash(git status)
37-
Bash(git diff)
35+
default: '--allowedTools "Bash(git status),Bash(git diff)"'
3836
timeout_minutes:
3937
description: 'Timeout in minutes for Claude execution'
4038
required: false
@@ -50,6 +48,11 @@ on:
5048
required: false
5149
type: boolean
5250
default: true
51+
skip_automatic_when_mentioned:
52+
description: 'Skip automatic mode when PR title/body contains @claude mention'
53+
required: false
54+
type: boolean
55+
default: true
5356
custom_trigger_condition:
5457
description: 'Custom condition to override default mention detection (optional)'
5558
required: false
@@ -96,12 +99,25 @@ jobs:
9699
contains(github.event.pull_request.body, '@CLAUDE')
97100
))
98101
)
99-
) || inputs.trigger_mode == 'automatic'
102+
) || (
103+
inputs.trigger_mode == 'automatic' && (
104+
inputs.skip_automatic_when_mentioned == false || (
105+
github.event_name != 'pull_request' || (
106+
!contains(github.event.pull_request.title, '@claude') &&
107+
!contains(github.event.pull_request.title, '@Claude') &&
108+
!contains(github.event.pull_request.title, '@CLAUDE') &&
109+
!contains(github.event.pull_request.body, '@claude') &&
110+
!contains(github.event.pull_request.body, '@Claude') &&
111+
!contains(github.event.pull_request.body, '@CLAUDE')
112+
)
113+
)
114+
)
115+
)
100116
uses: ./.github/workflows/claude-executor.yml
101117
with:
102118
trigger_mode: ${{ inputs.trigger_mode }}
103-
direct_prompt: ${{ inputs.direct_prompt }}
104-
allowed_tools: ${{ inputs.allowed_tools }}
119+
prompt: ${{ inputs.prompt }}
120+
claude_args: ${{ inputs.claude_args }}
105121
timeout_minutes: ${{ inputs.timeout_minutes }}
106122
runner: ${{ inputs.runner }}
107123
secrets:

CLAUDE.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ Consumer repositories handle their own webhook triggers and conditional logic, t
9191
```yaml
9292
jobs:
9393
claude-interactive:
94+
if: |
95+
github.event_name != 'pull_request' || (
96+
contains(github.event.pull_request.title, '@claude') ||
97+
contains(github.event.pull_request.title, '@Claude') ||
98+
contains(github.event.pull_request.title, '@CLAUDE') ||
99+
contains(github.event.pull_request.body, '@claude') ||
100+
contains(github.event.pull_request.body, '@Claude') ||
101+
contains(github.event.pull_request.body, '@CLAUDE')
102+
)
94103
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
95104
with:
96105
trigger_mode: interactive
@@ -110,6 +119,7 @@ jobs:
110119
with:
111120
trigger_mode: automatic
112121
enable_mention_detection: false
122+
skip_automatic_when_mentioned: true # Default; avoids overlap with @claude PR mentions
113123
direct_prompt: |
114124
Please review this pull request for code quality and security.
115125
allowed_tools: |
@@ -138,6 +148,13 @@ jobs:
138148
139149
See `examples/` directory for complete working examples.
140150

151+
### Dual invocation troubleshooting
152+
153+
If interactive and automatic jobs exist in the same consumer workflow:
154+
- Add a job-level `if` guard to the interactive job so non-mention PR open/sync events do not invoke it.
155+
- Keep automatic job scoped to `pull_request`.
156+
- Use `skip_automatic_when_mentioned: true` (default) so automatic mode does not overlap when PR title/body includes `@claude`.
157+
141158
## Deployment Guard Workflow
142159

143160
The deployment-guard workflow provides configurable validation for deployment changes:
@@ -188,4 +205,3 @@ Sophisticated version comparison supporting dotCMS format: `YY.MM.DD[-REBUILD][_
188205
- **CLAUDE_WORKFLOW_MIGRATION.md**: Step-by-step migration guide from pilot workflows
189206
- **.cursor/rules/**: Modular development rules covering terminal commands, git workflow, release process, error prevention, and collaboration patterns
190207
- **examples/**: Working examples for general-purpose, infrastructure, and advanced custom triggers
191-

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,17 @@ on:
219219
types: [opened, synchronize]
220220
221221
jobs:
222-
# Interactive Claude mentions using built-in detection
222+
# Interactive Claude mentions (guarded to avoid PR opened/synchronize noise)
223223
claude-interactive:
224+
if: |
225+
github.event_name != 'pull_request' || (
226+
contains(github.event.pull_request.title, '@claude') ||
227+
contains(github.event.pull_request.title, '@Claude') ||
228+
contains(github.event.pull_request.title, '@CLAUDE') ||
229+
contains(github.event.pull_request.body, '@claude') ||
230+
contains(github.event.pull_request.body, '@Claude') ||
231+
contains(github.event.pull_request.body, '@CLAUDE')
232+
)
224233
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
225234
with:
226235
trigger_mode: interactive
@@ -231,7 +240,7 @@ jobs:
231240
secrets:
232241
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
233242
234-
# Automatic PR reviews (no @claude mention required)
243+
# Automatic PR reviews (orchestrator skips when @claude mention exists by default)
235244
claude-automatic:
236245
if: github.event_name == 'pull_request'
237246
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
@@ -243,6 +252,7 @@ jobs:
243252
Bash(git status)
244253
Bash(git diff)
245254
enable_mention_detection: false # No mention detection for automatic reviews
255+
# skip_automatic_when_mentioned: false # Optional: allow automatic mode even with @claude mention
246256
secrets:
247257
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
248258
```
@@ -257,6 +267,7 @@ jobs:
257267
| `timeout_minutes` | Timeout for Claude execution | No | 15 |
258268
| `runner` | GitHub runner to use | No | ubuntu-latest |
259269
| `enable_mention_detection` | Enable built-in @claude mention detection | No | true |
270+
| `skip_automatic_when_mentioned` | Skip automatic mode when PR title/body contains @claude | No | true |
260271
| `custom_trigger_condition` | Custom condition to override default detection | No | - |
261272

262273
### 4. Advanced: Custom Trigger Conditions
@@ -283,6 +294,28 @@ jobs:
283294

284295
**Note**: When using `custom_trigger_condition`, set `enable_mention_detection: false` to avoid conflicts.
285296

297+
### 5. Dual Invocation Troubleshooting
298+
299+
If you run both interactive and automatic jobs in the same workflow:
300+
301+
- Add a job-level guard to `claude-interactive` so it does not invoke on every `pull_request` opened/synchronize event.
302+
- Keep `claude-automatic` scoped to `pull_request` events.
303+
- Rely on `skip_automatic_when_mentioned: true` (default) to prevent automatic reviews from overlapping when `@claude` appears in PR title/body.
304+
305+
Minimal interactive guard:
306+
307+
```yaml
308+
if: |
309+
github.event_name != 'pull_request' || (
310+
contains(github.event.pull_request.title, '@claude') ||
311+
contains(github.event.pull_request.title, '@Claude') ||
312+
contains(github.event.pull_request.title, '@CLAUDE') ||
313+
contains(github.event.pull_request.body, '@claude') ||
314+
contains(github.event.pull_request.body, '@Claude') ||
315+
contains(github.event.pull_request.body, '@CLAUDE')
316+
)
317+
```
318+
286319
---
287320

288321
## Examples

examples/advanced-custom-triggers.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
jobs:
3232
# Example 1: Custom trigger for urgent issues only
3333
claude-urgent-issues:
34-
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
34+
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v2.0.0
3535
with:
3636
trigger_mode: interactive
3737
# Custom condition: Only trigger for issues labeled as "urgent" or "critical"
@@ -41,9 +41,7 @@ jobs:
4141
contains(github.event.issue.labels.*.name, 'critical') ||
4242
contains(github.event.issue.labels.*.name, 'P0')
4343
)
44-
allowed_tools: |
45-
Bash(git status)
46-
Bash(git diff)
44+
claude_args: '--allowedTools "Bash(git status),Bash(git diff)"'
4745
timeout_minutes: 10
4846
runner: ubuntu-latest
4947
enable_mention_detection: false # Disable default @claude detection since we have custom logic
@@ -52,7 +50,7 @@ jobs:
5250

5351
# Example 2: Custom trigger for specific file changes
5452
claude-config-changes:
55-
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
53+
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v2.0.0
5654
with:
5755
trigger_mode: automatic
5856
# Custom condition: Only trigger for PRs that modify configuration files
@@ -62,17 +60,14 @@ jobs:
6260
contains(github.event.pull_request.body, 'configuration') ||
6361
github.event.pull_request.changed_files > 10
6462
)
65-
direct_prompt: |
66-
This PR appears to modify configuration files or has many changes.
63+
prompt: |
64+
This PR appears to modify configuration files or has many changes.
6765
Please review for:
6866
- Configuration syntax and validity
6967
- Potential breaking changes
7068
- Security implications of config changes
7169
- Impact on existing functionality
72-
allowed_tools: |
73-
Bash(git status)
74-
Bash(git diff)
75-
Bash(grep -r "config" .)
70+
claude_args: '--allowedTools "Bash(git status),Bash(git diff),Bash(grep -r \"config\" .)"'
7671
timeout_minutes: 15
7772
runner: ubuntu-latest
7873
enable_mention_detection: false
@@ -81,7 +76,7 @@ jobs:
8176

8277
# Example 3: Custom trigger combining multiple conditions
8378
claude-security-review:
84-
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
79+
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v2.0.0
8580
with:
8681
trigger_mode: automatic
8782
# Custom condition: Security-related changes or mentions
@@ -96,17 +91,14 @@ jobs:
9691
contains(github.event.comment.body, 'security review') ||
9792
contains(github.event.comment.body, '@security-team')
9893
))
99-
direct_prompt: |
94+
prompt: |
10095
This appears to be a security-related change. Please provide a thorough security review focusing on:
10196
- Authentication and authorization mechanisms
10297
- Input validation and sanitization
10398
- Potential security vulnerabilities
10499
- Compliance with security best practices
105100
- Impact on existing security controls
106-
allowed_tools: |
107-
Bash(git status)
108-
Bash(git diff)
109-
Bash(grep -r "password\|token\|secret\|key" . --exclude-dir=.git)
101+
claude_args: '--allowedTools "Bash(git status),Bash(git diff)"'
110102
timeout_minutes: 20
111103
runner: ubuntu-latest
112104
enable_mention_detection: false
@@ -115,13 +107,11 @@ jobs:
115107

116108
# Example 4: Fallback with default @claude mention detection
117109
claude-general:
118-
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
110+
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v2.0.0
119111
with:
120112
trigger_mode: interactive
121113
# No custom condition - will use default @claude mention detection
122-
allowed_tools: |
123-
Bash(git status)
124-
Bash(git diff)
114+
claude_args: '--allowedTools "Bash(git status),Bash(git diff)"'
125115
timeout_minutes: 15
126116
runner: ubuntu-latest
127117
enable_mention_detection: true # Use default @claude mention detection

examples/consumer-repo-workflow.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,21 @@ on:
2929
branches: [main, master]
3030

3131
jobs:
32-
# Interactive Claude mentions (simplified using centralized logic)
32+
# Interactive Claude mentions (guarded to avoid PR opened/synchronize noise)
3333
claude-interactive:
34-
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
34+
if: |
35+
github.event_name != 'pull_request' || (
36+
contains(github.event.pull_request.title, '@claude') ||
37+
contains(github.event.pull_request.title, '@Claude') ||
38+
contains(github.event.pull_request.title, '@CLAUDE') ||
39+
contains(github.event.pull_request.body, '@claude') ||
40+
contains(github.event.pull_request.body, '@Claude') ||
41+
contains(github.event.pull_request.body, '@CLAUDE')
42+
)
43+
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v2.0.0
3544
with:
3645
trigger_mode: interactive
37-
allowed_tools: |
38-
Bash(git status)
39-
Bash(git diff)
46+
claude_args: '--allowedTools "Bash(git status),Bash(git diff)"'
4047
timeout_minutes: 15
4148
runner: ubuntu-latest
4249
enable_mention_detection: true # Uses built-in @claude mention detection
@@ -45,20 +52,13 @@ jobs:
4552
secrets:
4653
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
4754

48-
# Automatic PR reviews (no @claude mention required)
55+
# Automatic PR reviews (orchestrator skips when @claude mention is present by default)
4956
claude-automatic-review:
50-
if: |
51-
github.event_name == 'pull_request' &&
52-
!contains(github.event.pull_request.title, '@claude') &&
53-
!contains(github.event.pull_request.title, '@Claude') &&
54-
!contains(github.event.pull_request.title, '@CLAUDE') &&
55-
!contains(github.event.pull_request.body, '@claude') &&
56-
!contains(github.event.pull_request.body, '@Claude') &&
57-
!contains(github.event.pull_request.body, '@CLAUDE')
58-
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
57+
if: github.event_name == 'pull_request'
58+
uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v2.0.0
5959
with:
6060
trigger_mode: automatic
61-
direct_prompt: |
61+
prompt: |
6262
Please review this pull request and provide feedback on:
6363
- Code quality and best practices
6464
- Potential bugs or issues
@@ -67,13 +67,12 @@ jobs:
6767
- Test coverage
6868
6969
Be constructive and helpful in your feedback.
70-
allowed_tools: |
71-
Bash(git status)
72-
Bash(git diff)
70+
claude_args: '--allowedTools "Bash(git status),Bash(git diff)"'
7371
timeout_minutes: 15
7472
runner: ubuntu-latest
7573
enable_mention_detection: false # No mention detection for automatic reviews
74+
# skip_automatic_when_mentioned: false # Optional: allow automatic mode even with @claude mention
7675
# custom_trigger_condition: | # Optional: Custom trigger logic
7776
# your custom condition here
7877
secrets:
79-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
78+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

0 commit comments

Comments
 (0)