|
12 | 12 |
|
13 | 13 | jobs: |
14 | 14 | claude: |
15 | | - # Only allow trusted collaborators to trigger Claude via @claude mention |
| 15 | + # Only allow trusted collaborators to trigger Claude |
16 | 16 | if: | |
17 | | - ( |
18 | | - github.event.comment.author_association == 'OWNER' || |
19 | | - github.event.comment.author_association == 'MEMBER' || |
20 | | - github.event.comment.author_association == 'COLLABORATOR' || |
21 | | - github.event.review.author_association == 'OWNER' || |
22 | | - github.event.review.author_association == 'MEMBER' || |
23 | | - github.event.review.author_association == 'COLLABORATOR' || |
24 | | - github.event.issue.author_association == 'OWNER' || |
25 | | - github.event.issue.author_association == 'MEMBER' || |
26 | | - github.event.issue.author_association == 'COLLABORATOR' |
27 | | - ) && ( |
28 | | - (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
29 | | - (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || |
30 | | - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || |
31 | | - (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) |
32 | | - ) |
| 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' |
33 | 26 | runs-on: ubuntu-latest |
34 | 27 | permissions: |
35 | 28 | contents: write |
36 | 29 | pull-requests: write |
37 | 30 | issues: write |
38 | 31 | actions: read |
39 | 32 | steps: |
40 | | - - name: Determine checkout ref |
41 | | - id: determine-ref |
42 | | - uses: actions/github-script@v7 |
43 | | - with: |
44 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
45 | | - script: | |
46 | | - const eventName = context.eventName; |
47 | | - let ref = context.sha; |
48 | | -
|
49 | | - if (eventName === 'pull_request_review' || eventName === 'pull_request_review_comment') { |
50 | | - ref = context.payload.pull_request.head.sha; |
51 | | - } else if (eventName === 'issue_comment' && context.payload.issue && context.payload.issue.pull_request) { |
52 | | - const prNumber = context.payload.issue.number; |
53 | | - const { data: pr } = await github.rest.pulls.get({ |
54 | | - owner: context.repo.owner, |
55 | | - repo: context.repo.repo, |
56 | | - pull_number: prNumber, |
57 | | - }); |
58 | | - ref = pr.head.sha; |
59 | | - } |
60 | | -
|
61 | | - core.setOutput('ref', ref); |
62 | | -
|
63 | 33 | - name: Checkout repository |
64 | 34 | uses: actions/checkout@v6 |
65 | | - with: |
66 | | - ref: ${{ steps.determine-ref.outputs.ref }} |
67 | 35 |
|
68 | 36 | - name: Set up JDK 21 |
69 | 37 | uses: actions/setup-java@v5 |
|
83 | 51 | uses: anthropics/claude-code-action@v1 |
84 | 52 | with: |
85 | 53 | anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
86 | | - |
87 | | - # Configure Claude's behavior for Android/Gradle project |
88 | 54 | claude_args: | |
89 | 55 | --model claude-opus-4-6 |
90 | 56 | --max-turns 20 |
|
0 commit comments