forked from tursodatabase/turso
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (67 loc) · 2.32 KB
/
claude.yml
File metadata and controls
72 lines (67 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
issues:
types: [assigned]
jobs:
claude:
concurrency:
group: claude-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: false
# Only run when:
# 1. @claude is mentioned in a comment on an issue or PR by an authorized user
# 2. @claude is mentioned in a PR review by an authorized user
# 3. claude[bot] is assigned to an issue
#
# Authorized users: OWNER, MEMBER, COLLABORATOR (prevents abuse by external users)
if: |
(
contains(fromJSON('["issue_comment", "pull_request_review_comment"]'), github.event_name) &&
contains(github.event.comment.body, '@claude') &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
) ||
(
github.event_name == 'pull_request_review' &&
contains(github.event.review.body, '@claude') &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)
) ||
(
github.event_name == 'issues' &&
github.event.assignee.login == 'claude[bot]'
)
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
issues: write
pull-requests: write
actions: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Run Claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
branch_prefix: "claude/"
additional_permissions: |
actions: read
claude_args: |
--model claude-opus-4-5-20251101
--max-turns 50
--allowedTools "Bash(cargo:*),Bash(git:*),Bash(make:*),Bash(rustfmt:*),Bash(python:*),Edit,Write,Read,Glob,Grep,TodoWrite,Task,WebSearch"
--disallowedTools "Bash(rm -rf *),Bash(sudo *),Bash(curl *),Bash(wget *)"