Skip to content

Commit 369a42d

Browse files
authored
ci: upgrade Claude action to v1 (#257)
Require write access before interactive Claude runs and migrate the workflows to the supported v1 prompt and CLI argument inputs.
1 parent 9007c0b commit 369a42d

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ jobs:
3737

3838
- name: Run Claude Code Review
3939
id: claude-review
40-
uses: anthropics/claude-code-action@28f83620103c48a57093dcc2837eec89e036bb9f # beta
40+
uses: anthropics/claude-code-action@9d7150bc8a3dae8149739a88019d192b579ad90c # v1.0.193
4141
with:
4242
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
4343

44-
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
45-
model: "claude-opus-4-8"
44+
claude_args: |
45+
--model claude-opus-4-8
4646
4747
# Direct prompt for automated review (no @claude mention needed)
48-
direct_prompt: |
48+
prompt: |
4949
Please review this pull request and provide feedback on:
5050
- Code quality and best practices
5151
- Potential bugs or issues
@@ -59,21 +59,21 @@ jobs:
5959
# use_sticky_comment: true
6060

6161
# Optional: Customize review based on file types
62-
# direct_prompt: |
62+
# prompt: |
6363
# Review this PR focusing on:
6464
# - For TypeScript files: Type safety and proper interface usage
6565
# - For API endpoints: Security, input validation, and error handling
6666
# - For React components: Performance, accessibility, and best practices
6767
# - For tests: Coverage, edge cases, and test quality
6868

6969
# Optional: Different prompts for different authors
70-
# direct_prompt: |
70+
# prompt: |
7171
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
7272
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
7373
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
7474

75-
# Optional: Add specific tools for running tests or linting
76-
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
75+
# Optional: Add this line to claude_args above to allow test or lint commands
76+
# --allowedTools "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
7777

7878
# Optional: Skip review for certain conditions
7979
# if: |

.github/workflows/claude.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,24 @@ jobs:
3535

3636
- name: Run Claude Code
3737
id: claude
38-
uses: anthropics/claude-code-action@28f83620103c48a57093dcc2837eec89e036bb9f # beta
38+
uses: anthropics/claude-code-action@9d7150bc8a3dae8149739a88019d192b579ad90c # v1.0.193
3939
with:
4040
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
4141

4242
# This is an optional setting that allows Claude to read CI results on PRs
4343
additional_permissions: |
4444
actions: read
4545
46-
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
47-
model: "claude-opus-4-8"
46+
claude_args: |
47+
--model claude-opus-4-8
48+
--allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
4849
4950
# Optional: Customize the trigger phrase (default: @claude)
5051
# trigger_phrase: "/claude"
5152

5253
# Optional: Trigger when specific user is assigned to an issue
5354
# assignee_trigger: "claude-bot"
5455

55-
# Optional: Allow Claude to run specific commands
56-
allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
57-
5856
# Optional: Add custom instructions for Claude to customize its behavior for your project
5957
# custom_instructions: |
6058
# Follow our coding standards

0 commit comments

Comments
 (0)