Skip to content

Commit 896139e

Browse files
Claude (Initial Force WPF Bot)claude
andcommitted
fix(workflows): pass prompt via action 'prompt:' input not --prompt-file
The anthropics/claude-code-action@v1 action does not honor --prompt-file in claude_args; without the 'prompt:' input it auto-detects mode but skips with 'No trigger found'. Read each prompt file in a preceding step into a step output and pass via the prompt: input. Validates the new pattern on pr-review.yml first; the other 5 Claude-using workflows get the same treatment in a follow-up commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 829a65d commit 896139e

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/pr-review.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,24 @@ jobs:
9393
with:
9494
python-version: "3.12"
9595

96+
- name: Load pr-review-1 prompt
97+
id: load-prompt-1
98+
shell: bash
99+
run: |
100+
{
101+
echo 'prompt<<__EOF_PROMPT__'
102+
cat .if-fork/prompts/pr-review-1.md
103+
echo
104+
echo '__EOF_PROMPT__'
105+
} >> "$GITHUB_OUTPUT"
106+
96107
- name: Run review-1 (Claude Opus — prompt pr-review-1.md)
97108
id: review
98109
uses: anthropics/claude-code-action@v1
99110
with:
100111
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
112+
prompt: ${{ steps.load-prompt-1.outputs.prompt }}
101113
claude_args: >-
102-
--prompt-file .if-fork/prompts/pr-review-1.md
103114
--max-turns 12
104115
--model claude-opus-4-7
105116
--allowedTools Bash,Read,Grep,mcp__github__pull_request_read,mcp__github__get_file_contents
@@ -171,13 +182,24 @@ jobs:
171182
with:
172183
python-version: "3.12"
173184

185+
- name: Load pr-review-2 prompt
186+
id: load-prompt-2
187+
shell: bash
188+
run: |
189+
{
190+
echo 'prompt<<__EOF_PROMPT__'
191+
cat .if-fork/prompts/pr-review-2.md
192+
echo
193+
echo '__EOF_PROMPT__'
194+
} >> "$GITHUB_OUTPUT"
195+
174196
- name: Run review-2 (Claude Opus — prompt pr-review-2.md, different from review-1)
175197
id: review
176198
uses: anthropics/claude-code-action@v1
177199
with:
178200
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
201+
prompt: ${{ steps.load-prompt-2.outputs.prompt }}
179202
claude_args: >-
180-
--prompt-file .if-fork/prompts/pr-review-2.md
181203
--max-turns 12
182204
--model claude-opus-4-7
183205
--allowedTools Bash,Read,Grep,mcp__github__pull_request_read,mcp__github__get_file_contents

0 commit comments

Comments
 (0)