Skip to content

Commit 743e429

Browse files
authored
Merge pull request #152 from androidbroadcast/feature/claude-code-integration
ci: add Claude Code GitHub Action integration
2 parents 5a9dd2c + 54052ee commit 743e429

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/claude.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
# Only allow trusted collaborators to trigger Claude
16+
if: |
17+
github.event.comment.author_association == 'OWNER' ||
18+
github.event.comment.author_association == 'MEMBER' ||
19+
github.event.comment.author_association == 'COLLABORATOR' ||
20+
github.event.review.author_association == 'OWNER' ||
21+
github.event.review.author_association == 'MEMBER' ||
22+
github.event.review.author_association == 'COLLABORATOR' ||
23+
github.event.issue.author_association == 'OWNER' ||
24+
github.event.issue.author_association == 'MEMBER' ||
25+
github.event.issue.author_association == 'COLLABORATOR'
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: write
29+
pull-requests: write
30+
issues: write
31+
actions: read
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v6
35+
36+
- name: Set up JDK 21
37+
uses: actions/setup-java@v5
38+
with:
39+
java-version: '21'
40+
distribution: 'temurin'
41+
cache: gradle
42+
43+
- name: Grant execute permission for gradlew
44+
run: chmod +x gradlew
45+
46+
- name: Setup Gradle
47+
uses: gradle/actions/setup-gradle@v4
48+
49+
- name: Run Claude Code
50+
id: claude
51+
uses: anthropics/claude-code-action@v1
52+
with:
53+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
54+
claude_args: |
55+
--model claude-opus-4-6
56+
--max-turns 20
57+
--allowedTools "Bash(./gradlew check),Bash(./gradlew assembleRelease),Bash(./gradlew ktlintFormat),Bash(./gradlew ktlintCheck),Bash(./gradlew detekt),Bash(./gradlew testDebugUnitTest),Bash(./gradlew koverHtmlReport),Bash(./gradlew koverXmlReport),Bash(./gradlew :vbpd-core:*),Bash(./gradlew :vbpd:*),Bash(./gradlew :vbpd-reflection:*),Bash(./gradlew :sample:*),Bash(git status),Bash(git diff),Bash(git log*),Bash(git show*)"
58+
--system-prompt "Android library project (ViewBindingPropertyDelegate). Three modules: vbpd-core (foundation), vbpd (lifecycle delegates), vbpd-reflection (reflection + cache). Follow CLAUDE.md: explicit API mode required, Kotlin code style 'official', JVM target 11. Always run ktlintFormat before commit. Use './gradlew check' to verify. PRs → develop (feature/fix/chore/docs branches), hotfixes → master. Version in gradle/libs.versions.toml. Package: dev.androidbroadcast.vbpd."

0 commit comments

Comments
 (0)