Skip to content

Commit 702feb8

Browse files
Fato07claude
andcommitted
feat: add Claude Code GitHub Action for automated bug fixing
Adds a workflow that triggers Claude to analyze and fix bugs automatically when issues are opened with the 'bug' label, and responds to @claude mentions on issues and PRs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent aaa430e commit 702feb8

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/claude.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened]
10+
11+
jobs:
12+
claude:
13+
# Only run on @claude mentions OR bug-labeled issues
14+
if: |
15+
(github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'bug')) ||
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude'))
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
issues: write
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- uses: actions/setup-go@v5
29+
with:
30+
go-version: '1.23'
31+
32+
- uses: anthropics/claude-code-action@v1
33+
with:
34+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
35+
# For auto-triggered bug issues, provide explicit instructions
36+
prompt: |
37+
${{ github.event_name == 'issues' && 'Analyze this bug report. Read the full codebase to understand the architecture. Fix the bug, run `go build ./...` and `go test ./...` to verify no regressions, then create a PR with the fix.' || '' }}

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,15 @@ Go 1.22: Follow standard conventions
3232
- 001-agit-architecture-impl: Added Go 1.22 + `github.com/mark3labs/mcp-go` v0.20.1 (MCP protocol), `github.com/spf13/cobra` v1.8.1 (CLI), `modernc.org/sqlite` v1.34.4 (database)
3333

3434
<!-- MANUAL ADDITIONS START -->
35+
36+
## CI Verification
37+
38+
When fixing bugs or implementing features, always run:
39+
```bash
40+
go build ./...
41+
go test ./... -race
42+
golangci-lint run
43+
```
44+
All three must pass before creating a PR.
45+
3546
<!-- MANUAL ADDITIONS END -->

0 commit comments

Comments
 (0)