Skip to content

Commit 3a8d1cd

Browse files
Merge pull request #64 from SimplicityGuy/add-claude-github-actions-1771734641346
Add Claude Code GitHub Workflow
2 parents 9006a20 + 36415b1 commit 3a8d1cd

3 files changed

Lines changed: 94 additions & 1 deletion

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Claude Code Review
3+
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, ready_for_review, reopened]
7+
# Optional: Only run on specific file changes
8+
# paths:
9+
# - "src/**/*.ts"
10+
# - "src/**/*.tsx"
11+
# - "src/**/*.js"
12+
# - "src/**/*.jsx"
13+
14+
jobs:
15+
claude-review:
16+
# Optional: Filter by PR author
17+
# if: |
18+
# github.event.pull_request.user.login == 'external-contributor' ||
19+
# github.event.pull_request.user.login == 'new-developer' ||
20+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
21+
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
issues: read
27+
id-token: write
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 1
34+
35+
- name: Run Claude Code Review
36+
id: claude-review
37+
uses: anthropics/claude-code-action@v1
38+
with:
39+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
40+
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
41+
plugins: 'code-review@claude-code-plugins'
42+
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
43+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
44+
# or https://code.claude.com/docs/en/cli-reference for available options

.github/workflows/claude.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Claude Code
3+
4+
on:
5+
issue_comment:
6+
types: [created]
7+
pull_request_review_comment:
8+
types: [created]
9+
issues:
10+
types: [opened, assigned]
11+
pull_request_review:
12+
types: [submitted]
13+
14+
jobs:
15+
claude:
16+
if: |
17+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
19+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
20+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
actions: read # Required for Claude to read CI results on PRs
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code
35+
id: claude
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
40+
# This is an optional setting that allows Claude to read CI results on PRs
41+
additional_permissions: |
42+
actions: read
43+
44+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
45+
# prompt: 'Update the pull request description to include a summary of changes.'
46+
47+
# Optional: Add claude_args to customize behavior and configuration
48+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
49+
# or https://code.claude.com/docs/en/cli-reference for available options
50+
# claude_args: '--allowed-tools Bash(gh pr:*)'

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ repos:
1616
- id: detect-private-key
1717
- id: end-of-file-fixer
1818
- id: mixed-line-ending
19-
- id: requirements-txt-fixer
2019
- id: trailing-whitespace
2120
- id: pretty-format-json
2221
args: [--autofix, --indent=2]

0 commit comments

Comments
 (0)