Skip to content

Commit 020764b

Browse files
paul-fractureclaude
andcommitted
Release v0.5.0: Simplify integration with reusable workflows
- Add reusable workflows for easier integration - Simplify README with clearer, more concise examples - Update version references to v0.5.0 - Make Claude integration require minimal setup - Add comprehensive but simple examples for both comment and label workflows 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent c0bc2f7 commit 020764b

File tree

8 files changed

+655
-330
lines changed

8 files changed

+655
-330
lines changed

.github/workflows/claude-full.yml

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
name: Claude Code Full Integration
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
issue-label:
7+
type: string
8+
description: 'Label that triggers issue fix workflows'
9+
default: 'claude-fix'
10+
required: false
11+
debug-mode:
12+
type: boolean
13+
description: 'Enable full debug output'
14+
default: false
15+
required: false
16+
branch-prefix:
17+
type: string
18+
description: 'Prefix for branches created for issue fixes'
19+
default: 'fix'
20+
required: false
21+
strict-mode:
22+
type: boolean
23+
description: 'Strictly follow user requests without adding unrelated improvements'
24+
default: true
25+
required: false
26+
secrets:
27+
ANTHROPIC_API_KEY:
28+
required: true
29+
GITHUB_TOKEN:
30+
required: true
31+
32+
jobs:
33+
# Handle issue analysis comments
34+
process-issue-analysis:
35+
runs-on: ubuntu-latest
36+
# Only run on issue comments (not PRs) that start with 'claude:'
37+
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude:') }}
38+
permissions:
39+
contents: read
40+
issues: write
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0
46+
47+
- name: Get issue details
48+
id: issue
49+
run: |
50+
ISSUE_NUMBER="${{ github.event.issue.number }}"
51+
FEEDBACK="${{ github.event.comment.body }}"
52+
# Remove the "claude:" prefix
53+
FEEDBACK="${FEEDBACK#claude:}"
54+
echo "number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT
55+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
56+
57+
- name: Process with Claude Code for issue analysis
58+
uses: fractureinc/[email protected]
59+
with:
60+
mode: 'issue-analyze'
61+
issue-number: ${{ steps.issue.outputs.number }}
62+
repo-owner: ${{ github.repository_owner }}
63+
repo-name: ${{ github.event.repository.name }}
64+
feedback: ${{ steps.issue.outputs.feedback }}
65+
debug-mode: ${{ inputs.debug-mode || 'false' }}
66+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
67+
github-token: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Upload claude output artifacts
70+
if: always()
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: claude-output-issue-analyze-${{ github.event.issue.number }}
74+
path: claude-output/
75+
76+
# Handle issue fix commands
77+
process-issue-fix-command:
78+
runs-on: ubuntu-latest
79+
# Only run on issue comments (not PRs) that start with 'claude-fix:'
80+
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude-fix:') }}
81+
permissions:
82+
contents: write
83+
pull-requests: write
84+
issues: write
85+
steps:
86+
- name: Checkout code
87+
uses: actions/checkout@v4
88+
with:
89+
fetch-depth: 0
90+
91+
- name: Setup GitHub CLI
92+
run: |
93+
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
94+
95+
- name: Setup git user
96+
run: |
97+
git config --global user.name "Claude Code Bot"
98+
git config --global user.email "[email protected]"
99+
100+
- name: Get issue details
101+
id: issue
102+
run: |
103+
ISSUE_NUMBER="${{ github.event.issue.number }}"
104+
FEEDBACK="${{ github.event.comment.body }}"
105+
# Remove the "claude-fix:" prefix
106+
FEEDBACK="${FEEDBACK#claude-fix:}"
107+
echo "number=$ISSUE_NUMBER" >> $GITHUB_OUTPUT
108+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
109+
110+
- name: Process with Claude Code for issue fix
111+
uses: fractureinc/[email protected]
112+
with:
113+
mode: 'issue-fix'
114+
issue-number: ${{ steps.issue.outputs.number }}
115+
repo-owner: ${{ github.repository_owner }}
116+
repo-name: ${{ github.event.repository.name }}
117+
branch-prefix: ${{ inputs.branch-prefix || 'fix' }}
118+
issue-label: ${{ inputs.issue-label || 'claude-fix' }}
119+
debug-mode: ${{ inputs.debug-mode || 'false' }}
120+
feedback: ${{ steps.issue.outputs.feedback }}
121+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
122+
github-token: ${{ secrets.GITHUB_TOKEN }}
123+
124+
- name: Upload claude output artifacts
125+
if: always()
126+
uses: actions/upload-artifact@v4
127+
with:
128+
name: claude-output-issue-fix-${{ github.event.issue.number }}
129+
path: claude-output/
130+
131+
# Handle PR comments
132+
process-pr-review:
133+
runs-on: ubuntu-latest
134+
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude:') }}
135+
permissions:
136+
contents: read
137+
pull-requests: write
138+
issues: write
139+
steps:
140+
- name: Checkout code
141+
uses: actions/checkout@v4
142+
with:
143+
fetch-depth: 0
144+
145+
- name: Get PR details
146+
id: pr
147+
run: |
148+
PR_NUMBER="${{ github.event.issue.number }}"
149+
FEEDBACK="${{ github.event.comment.body }}"
150+
# Remove the "claude:" prefix
151+
FEEDBACK="${FEEDBACK#claude:}"
152+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
153+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
154+
155+
- name: Process with Claude Code
156+
uses: fractureinc/[email protected]
157+
with:
158+
mode: 'review'
159+
pr-number: ${{ steps.pr.outputs.number }}
160+
feedback: ${{ steps.pr.outputs.feedback }}
161+
debug-mode: ${{ inputs.debug-mode || 'false' }}
162+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
163+
github-token: ${{ secrets.GITHUB_TOKEN }}
164+
165+
process-pr-suggestions:
166+
runs-on: ubuntu-latest
167+
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, 'claude-suggest:') }}
168+
permissions:
169+
contents: read
170+
pull-requests: write
171+
issues: write
172+
steps:
173+
- name: Checkout code
174+
uses: actions/checkout@v4
175+
with:
176+
fetch-depth: 0
177+
178+
- name: Get PR details
179+
id: pr
180+
run: |
181+
PR_NUMBER="${{ github.event.issue.number }}"
182+
FEEDBACK="${{ github.event.comment.body }}"
183+
# Remove the "claude-suggest:" prefix
184+
FEEDBACK="${FEEDBACK#claude-suggest:}"
185+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
186+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
187+
188+
- name: Process with Claude Code Suggestions
189+
uses: fractureinc/[email protected]
190+
with:
191+
mode: 'suggest'
192+
pr-number: ${{ steps.pr.outputs.number }}
193+
feedback: ${{ steps.pr.outputs.feedback }}
194+
strict-mode: ${{ inputs.strict-mode || 'true' }}
195+
debug-mode: ${{ inputs.debug-mode || 'false' }}
196+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
197+
github-token: ${{ secrets.GITHUB_TOKEN }}
198+
199+
# Handle code review comments
200+
process-review-comment:
201+
runs-on: ubuntu-latest
202+
if: ${{ github.event_name == 'pull_request_review_comment' && startsWith(github.event.comment.body, 'claude:') }}
203+
permissions:
204+
contents: read
205+
pull-requests: write
206+
issues: write
207+
steps:
208+
- name: Checkout code
209+
uses: actions/checkout@v4
210+
with:
211+
fetch-depth: 0
212+
213+
- name: Get PR and comment details
214+
id: details
215+
run: |
216+
PR_NUMBER="${{ github.event.pull_request.number }}"
217+
FEEDBACK="${{ github.event.comment.body }}"
218+
# Remove the "claude:" prefix
219+
FEEDBACK="${FEEDBACK#claude:}"
220+
COMMENT_ID="${{ github.event.comment.id }}"
221+
FILE_PATH="${{ github.event.comment.path }}"
222+
LINE="${{ github.event.comment.line }}"
223+
224+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
225+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
226+
echo "comment_id=$COMMENT_ID" >> $GITHUB_OUTPUT
227+
echo "file_path=$FILE_PATH" >> $GITHUB_OUTPUT
228+
echo "line=$LINE" >> $GITHUB_OUTPUT
229+
230+
- name: Process with Claude Code for code review comment
231+
uses: fractureinc/[email protected]
232+
with:
233+
mode: 'review'
234+
pr-number: ${{ steps.details.outputs.number }}
235+
feedback: ${{ steps.details.outputs.feedback }}
236+
debug-mode: ${{ inputs.debug-mode || 'false' }}
237+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
238+
github-token: ${{ secrets.GITHUB_TOKEN }}
239+
240+
process-suggest-review-comment:
241+
runs-on: ubuntu-latest
242+
if: ${{ github.event_name == 'pull_request_review_comment' && startsWith(github.event.comment.body, 'claude-suggest:') }}
243+
permissions:
244+
contents: read
245+
pull-requests: write
246+
issues: write
247+
steps:
248+
- name: Checkout code
249+
uses: actions/checkout@v4
250+
with:
251+
fetch-depth: 0
252+
253+
- name: Get PR and comment details
254+
id: details
255+
run: |
256+
PR_NUMBER="${{ github.event.pull_request.number }}"
257+
FEEDBACK="${{ github.event.comment.body }}"
258+
# Remove the "claude-suggest:" prefix
259+
FEEDBACK="${FEEDBACK#claude-suggest:}"
260+
COMMENT_ID="${{ github.event.comment.id }}"
261+
FILE_PATH="${{ github.event.comment.path }}"
262+
LINE="${{ github.event.comment.line }}"
263+
264+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
265+
echo "feedback=$FEEDBACK" >> $GITHUB_OUTPUT
266+
echo "comment_id=$COMMENT_ID" >> $GITHUB_OUTPUT
267+
echo "file_path=$FILE_PATH" >> $GITHUB_OUTPUT
268+
echo "line=$LINE" >> $GITHUB_OUTPUT
269+
270+
- name: Process with Claude Code Suggestions for code review
271+
uses: fractureinc/[email protected]
272+
with:
273+
mode: 'suggest-review'
274+
pr-number: ${{ steps.details.outputs.number }}
275+
feedback: ${{ steps.details.outputs.feedback }}
276+
file-path: ${{ steps.details.outputs.file_path }}
277+
line-number: ${{ steps.details.outputs.line }}
278+
comment-id: ${{ steps.details.outputs.comment_id }}
279+
strict-mode: ${{ inputs.strict-mode || 'true' }}
280+
debug-mode: ${{ inputs.debug-mode || 'false' }}
281+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
282+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Claude Code Label-Based Fix
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
issue-label:
7+
type: string
8+
description: 'Label that triggers issue fix workflows'
9+
default: 'claude-fix'
10+
required: false
11+
debug-mode:
12+
type: boolean
13+
description: 'Enable full debug output'
14+
default: false
15+
required: false
16+
branch-prefix:
17+
type: string
18+
description: 'Prefix for branches created for issue fixes'
19+
default: 'fix'
20+
required: false
21+
secrets:
22+
ANTHROPIC_API_KEY:
23+
required: true
24+
GITHUB_TOKEN:
25+
required: true
26+
27+
jobs:
28+
process-issue-fix:
29+
runs-on: ubuntu-latest
30+
# Run on issues with the configured label (default: 'claude-fix')
31+
if: ${{ github.event.label.name == inputs.issue-label || github.event.label.name == 'claude-fix' }}
32+
permissions:
33+
contents: write
34+
pull-requests: write
35+
issues: write
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Setup GitHub CLI
43+
run: |
44+
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
45+
46+
- name: Setup git user
47+
run: |
48+
git config --global user.name "Claude Code Bot"
49+
git config --global user.email "[email protected]"
50+
51+
- name: Process issue with Claude Code
52+
uses: fractureinc/[email protected]
53+
with:
54+
mode: 'issue-fix'
55+
issue-number: ${{ github.event.issue.number }}
56+
repo-owner: ${{ github.repository_owner }}
57+
repo-name: ${{ github.event.repository.name }}
58+
branch-prefix: ${{ inputs.branch-prefix || 'fix' }}
59+
issue-label: ${{ inputs.issue-label || 'claude-fix' }}
60+
debug-mode: ${{ inputs.debug-mode || 'false' }}
61+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
62+
github-token: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Upload claude output artifacts
65+
if: always()
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: claude-output-issue-${{ github.event.issue.number }}
69+
path: claude-output/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Claude Code Integration
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
9+
# This demonstrates how to use the reusable workflow for comment-based interactions
10+
jobs:
11+
claude-integration:
12+
uses: fractureinc/claude-code-github-action/.github/workflows/[email protected]
13+
with:
14+
# Optional customizations:
15+
issue-label: 'claude-fix' # The label used to trigger issue fixes
16+
branch-prefix: 'fix' # Prefix for branches created for fixes
17+
debug-mode: false # Set to true for verbose logging
18+
strict-mode: true # Set to false to allow Claude to make additional improvements
19+
secrets:
20+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)