Skip to content

Commit 8337a4f

Browse files
ondrejmirtesclaude
andcommitted
Use Claude Code GitHub Action in issue-bot workflow
- Replace `npm install -g @anthropic-ai/claude-code` + `claude -p` with `anthropics/claude-code-action@v1` - Move inline ${{ }} step output to env var in Update PR description step Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 998c151 commit 8337a4f

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

.github/workflows/issue-bot.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -281,31 +281,26 @@ jobs:
281281
if: steps.check.outputs.skip != 'true'
282282
uses: "ramsey/composer-install@v3"
283283

284-
- name: "Install Claude Code"
285-
if: steps.check.outputs.skip != 'true'
286-
run: npm install -g @anthropic-ai/claude-code
287-
288284
- name: "Save HEAD before generation"
289285
if: steps.check.outputs.skip != 'true'
290286
id: before
291-
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
292-
293-
- name: "Generate regression tests"
294-
if: steps.check.outputs.skip != 'true'
295-
env:
296-
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
297-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
298287
run: |
299288
git config user.name "phpstan-bot"
300289
git config user.email "ondrej+phpstanbot@mirtes.cz"
290+
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
301291
302-
claude -p \
303-
--model claude-opus-4-6 \
304-
"Read the file ./tmp/step-summary.md which contains the Issue Bot step summary from CI in Markdown format. Interpret this Markdown to figure out which GitHub issues need regression tests added. For each affected issue (where behavior changed), run /regression-test with the issue number.
292+
- name: "Generate regression tests"
293+
if: steps.check.outputs.skip != 'true'
294+
uses: anthropics/claude-code-action@v1
295+
with:
296+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
297+
claude_args: "--model claude-opus-4-6"
298+
prompt: |
299+
Read the file ./tmp/step-summary.md which contains the Issue Bot step summary from CI in Markdown format. Interpret this Markdown to figure out which GitHub issues need regression tests added. For each affected issue (where behavior changed), run /regression-test with the issue number.
305300
306-
Also read the diff of this branch to see what has already been done. The primary fixed issue will already have a test committed. The Issue Bot step summary might mention other fixed issues, so please add regression tests for those.
301+
Also read the diff of this branch to see what has already been done. The primary fixed issue will already have a test committed. The Issue Bot step summary might mention other fixed issues, so please add regression tests for those.
307302
308-
Do not create a branch or push - this will be handled automatically."
303+
Do not create a branch or push - this will be handled automatically.
309304
310305
- name: "Push"
311306
if: steps.check.outputs.skip != 'true'
@@ -321,8 +316,8 @@ jobs:
321316
if: steps.check.outputs.skip != 'true'
322317
env:
323318
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
319+
BEFORE_SHA: ${{ steps.before.outputs.sha }}
324320
run: |
325-
BEFORE_SHA="${{ steps.before.outputs.sha }}"
326321
CURRENT_SHA="$(git rev-parse HEAD)"
327322
328323
if [ "$BEFORE_SHA" = "$CURRENT_SHA" ]; then

0 commit comments

Comments
 (0)