Skip to content

Commit b866ab9

Browse files
authored
Add Claude Code GitHub Workflow (#23)
* "Update Claude PR Assistant workflow" * "Update Claude Code Review workflow"
1 parent 3c8fc0b commit b866ab9

File tree

2 files changed

+19
-29
lines changed

2 files changed

+19
-29
lines changed

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

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ name: Claude Code Review
22

33
on:
44
pull_request:
5-
types: [opened, synchronize]
6-
paths-ignore:
7-
- '**.md'
8-
- 'LICENSE'
9-
- '.gitignore'
5+
types: [opened, synchronize, ready_for_review, reopened]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
1012

1113
jobs:
1214
claude-review:
@@ -18,11 +20,10 @@ jobs:
1820

1921
runs-on: ubuntu-latest
2022
permissions:
21-
contents: write
22-
pull-requests: write
23-
issues: write
23+
contents: read
24+
pull-requests: read
25+
issues: read
2426
id-token: write
25-
actions: read
2627

2728
steps:
2829
- name: Checkout repository
@@ -35,21 +36,9 @@ jobs:
3536
uses: anthropics/claude-code-action@v1
3637
with:
3738
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38-
prompt: |
39-
REPO: ${{ github.repository }}
40-
PR NUMBER: ${{ github.event.pull_request.number }}
41-
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
48-
49-
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
50-
51-
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
52-
39+
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
40+
plugins: 'code-review@claude-code-plugins'
41+
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
5342
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5443
# or https://code.claude.com/docs/en/cli-reference for available options
55-
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:*)"'
44+

.github/workflows/claude.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
2020
runs-on: ubuntu-latest
2121
permissions:
22-
contents: write
23-
pull-requests: write
24-
issues: write
22+
contents: read
23+
pull-requests: read
24+
issues: read
2525
id-token: write
26-
actions: read
26+
actions: read # Required for Claude to read CI results on PRs
2727
steps:
2828
- name: Checkout repository
2929
uses: actions/checkout@v4
@@ -47,3 +47,4 @@ jobs:
4747
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4848
# or https://code.claude.com/docs/en/cli-reference for available options
4949
# claude_args: '--allowed-tools Bash(gh pr:*)'
50+

0 commit comments

Comments
 (0)