Skip to content

Commit a52795d

Browse files
authored
chore: Claude PR Assistant workflow (#13)
* "Claude PR Assistant workflow" * chore: Update Claude workflow configuration
1 parent 5a3f97b commit a52795d

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/claude.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
name: Claude Code
3+
4+
on:
5+
issue_comment:
6+
types:
7+
- created
8+
pull_request_review_comment:
9+
types:
10+
- created
11+
issues:
12+
types:
13+
- opened
14+
- assigned
15+
pull_request_review:
16+
types:
17+
- submitted
18+
19+
jobs:
20+
claude:
21+
if: |
22+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && !contains(github.event.comment.body, '@claude /review')) ||
23+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && !contains(github.event.comment.body, '@claude /review')) ||
24+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && !contains(github.event.review.body, '@claude /review')) ||
25+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
26+
runs-on: ubuntu-24.04
27+
permissions:
28+
contents: write
29+
pull-requests: write
30+
issues: write
31+
id-token: write
32+
actions: read
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v5
36+
with:
37+
fetch-depth: 1
38+
39+
- name: Install Rust toolchain
40+
uses: actions-rust-lang/setup-rust-toolchain@v1
41+
with:
42+
components: clippy, rustfmt
43+
44+
- name: Install task
45+
run: |
46+
curl -s https://taskfile.dev/install.sh | sh -s -- -b /usr/local/bin v3.45.4
47+
48+
- name: Run Claude Code
49+
id: claude
50+
uses: anthropics/claude-code-action@main
51+
with:
52+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
53+
additional_permissions: |
54+
actions: read
55+
use_commit_signing: true
56+
base_branch: main
57+
branch_prefix: 'claude/'
58+
claude_args: |
59+
--system-prompt "IMPORTANT: You must NEVER push directly to the main branch. Always: 1. Create a new feature branch (claude/feature-name), 2. Make your changes on the feature branch, 3. Open a pull request to main. COMMIT MESSAGE FORMAT: Always use conventional commits with capital letters. Follow the format: 'type(scope): Description' where the description starts with a capital letter. Examples: 'feat(grafana): Add retry mechanism for agent connections', 'fix(auth): Resolve token validation issue'. Follow the development workflow specified in the coding instructions."
60+
--allowedTools "Bash(task:*),Bash(go:*),Bash(gh:*),Bash(git:*)"
61+
--mcp-config '{"mcpServers":{"context7":{"command":"npx","args":["-y","@upstash/context7-mcp@latest"]}}}'

0 commit comments

Comments
 (0)