Skip to content

Commit 51fe8fc

Browse files
authored
chore: Fix claude (#3042)
* chore: Fix claude Remove dup'ed workflow and don't pin the action. * Fix merge * Fix
1 parent fb47282 commit 51fe8fc

2 files changed

Lines changed: 25 additions & 81 deletions

File tree

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

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/claude.yml

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
name: Claude Code
1+
name: Claude Code Review
22

33
on:
4-
issue_comment:
5-
types: [created]
6-
pull_request_review_comment:
7-
types: [created]
8-
issues:
9-
types: [opened, assigned]
10-
pull_request_review:
11-
types: [submitted]
4+
pull_request:
5+
branches: ["main"]
6+
types: [opened, synchronize]
127

138
concurrency:
149
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -18,42 +13,45 @@ permissions:
1813
contents: read
1914

2015
jobs:
21-
claude:
22-
name: Claude
23-
if: |
24-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
25-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
26-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
27-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
28-
runs-on: ubuntu-latest
16+
claude-review:
17+
name: Claude Code Review
18+
19+
runs-on: ubuntu-24.04
2920
permissions:
3021
contents: read
3122
pull-requests: read # Required to read PR details.
3223
issues: read # Required to read issue details.
3324
id-token: write # Required for OIDC authentication.
34-
actions: read # Required for Claude to read CI results on PRs
25+
3526
steps:
3627
- name: Checkout repository
3728
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3829
with:
3930
fetch-depth: 1
4031
persist-credentials: false
4132

42-
- name: Run Claude Code
33+
- name: Run Claude Code Review
4334
id: claude
44-
uses: anthropics/claude-code-action@f30f5eecfce2f34fa72e40fa5f7bcdbdcad12eb8 # v1.0.14
35+
# TODO: Would like to pin this, but the Mozilla org allowlist requires "anthropics/claude-code-action@v1"
36+
uses: anthropics/claude-code-action@v1 # zizmor: ignore[unpinned-uses]
4537
with:
4638
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
use_sticky_comment: true
40+
use_commit_signing: true
41+
prompt: |
42+
Please review this pull request and provide feedback on:
43+
- Code quality and best practices
44+
- Potential bugs or issues
45+
- Performance considerations
46+
- Security concerns
47+
- Test coverage
4748
48-
# This is an optional setting that allows Claude to read CI results on PRs
49-
additional_permissions: |
50-
actions: read
49+
Follow the detailed instructions in `.github/copilot-instructions.md` as you prepare your review.
50+
If that file is changed as part of a PR, use the changed version instead of the file in the main branch.
5151
52-
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
53-
# prompt: 'Update the pull request description to include a summary of changes.'
52+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
5453
55-
# Optional: Add claude_args to customize behavior and configuration
5654
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5755
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
58-
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
56+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
5957

0 commit comments

Comments
 (0)