|
7 | 7 | types: [created] |
8 | 8 | issues: |
9 | 9 | types: [opened, assigned] |
10 | | - pull_request_review: |
11 | | - types: [submitted] |
12 | 10 |
|
13 | 11 | jobs: |
14 | 12 | claude: |
15 | 13 | if: | |
16 | | - (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
17 | | - (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || |
18 | | - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || |
19 | | - (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) |
| 14 | + ( |
| 15 | + github.event.sender.login == github.repository_owner || |
| 16 | + github.event.comment.author_association == 'OWNER' || |
| 17 | + github.event.comment.author_association == 'MEMBER' || |
| 18 | + github.event.comment.author_association == 'COLLABORATOR' || |
| 19 | + github.event.issue.author_association == 'OWNER' || |
| 20 | + github.event.issue.author_association == 'MEMBER' || |
| 21 | + github.event.issue.author_association == 'COLLABORATOR' |
| 22 | + ) && ( |
| 23 | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || |
| 24 | + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || |
| 25 | + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) |
| 26 | + ) |
20 | 27 | runs-on: ubuntu-latest |
21 | 28 | permissions: |
22 | 29 | contents: read |
23 | 30 | pull-requests: read |
24 | 31 | issues: read |
25 | 32 | id-token: write |
26 | | - actions: read # Required for Claude to read CI results on PRs |
| 33 | + actions: read |
27 | 34 | steps: |
28 | 35 | - name: Checkout repository |
29 | 36 | uses: actions/checkout@v4 |
|
35 | 42 | uses: anthropics/claude-code-action@v1 |
36 | 43 | with: |
37 | 44 | claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
38 | | - |
39 | | - # This is an optional setting that allows Claude to read CI results on PRs |
40 | 45 | additional_permissions: | |
41 | 46 | actions: read |
42 | | -
|
43 | | - # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it. |
44 | | - # prompt: 'Update the pull request description to include a summary of changes.' |
45 | | - |
46 | | - # Optional: Add claude_args to customize behavior and configuration |
47 | | - # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md |
48 | | - # or https://code.claude.com/docs/en/cli-reference for available options |
49 | | - # claude_args: '--allowed-tools Bash(gh pr:*)' |
50 | | - |
0 commit comments