Skip to content

Commit 7a53af2

Browse files
committed
add workflow
1 parent 0962477 commit 7a53af2

2 files changed

Lines changed: 70 additions & 38 deletions

File tree

.github/workflows/claude-code.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Claude Code Integration
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
process-pr-review:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude:') }}
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
issues: write
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Get PR details
22+
id: pr
23+
run: |
24+
PR_NUMBER="${{ github.event.issue.number }}"
25+
FEEDBACK="${{ github.event.comment.body }}"
26+
# Remove the "claude:" prefix
27+
FEEDBACK="${FEEDBACK#claude:}"
28+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
29+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
30+
31+
- name: Process with Claude Code
32+
uses: fractureinc/claude-code-github-action@v0.2.0
33+
with:
34+
mode: 'review'
35+
pr-number: ${{ steps.pr.outputs.number }}
36+
feedback: ${{ steps.pr.outputs.feedback }}
37+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
38+
github-token: ${{ secrets.GITHUB_TOKEN }}
39+
40+
process-pr-suggestions:
41+
runs-on: ubuntu-latest
42+
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude-suggest:') }}
43+
permissions:
44+
contents: read
45+
pull-requests: write
46+
issues: write
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
53+
- name: Get PR details
54+
id: pr
55+
run: |
56+
PR_NUMBER="${{ github.event.issue.number }}"
57+
FEEDBACK="${{ github.event.comment.body }}"
58+
# Remove the "claude-suggest:" prefix
59+
FEEDBACK="${FEEDBACK#claude-suggest:}"
60+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
61+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
62+
63+
- name: Process with Claude Code Suggestions
64+
uses: fractureinc/claude-code-github-action@v0.2.0
65+
with:
66+
mode: 'suggest'
67+
pr-number: ${{ steps.pr.outputs.number }}
68+
feedback: ${{ steps.pr.outputs.feedback }}
69+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
70+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

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

0 commit comments

Comments
 (0)