Skip to content

Commit f7e2331

Browse files
MarjovanLierclaude
andauthored
Add Claude Code GitHub Workflow (#46)
* Add Claude PR Assistant workflow * fix(claude): Update permissions and add security restrictions - Change pull-requests and issues permissions from read to write to allow Claude to respond - Add user restriction to only allow MarjovanLier to trigger Claude - Add repository check to prevent workflow tampering from forks - Prevent unauthorized API usage and costs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent eb112d2 commit f7e2331

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/claude.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
github.repository == 'MarjovanLier/StringManipulation' &&
17+
github.actor == 'MarjovanLier' && (
18+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
19+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
20+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
21+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
22+
)
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
pull-requests: write
27+
issues: write
28+
id-token: write
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 1
34+
35+
- name: Run Claude Code
36+
id: claude
37+
uses: anthropics/claude-code-action@beta
38+
with:
39+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

0 commit comments

Comments
 (0)