Skip to content

Commit d40ae3d

Browse files
ikraamgclaude
andcommitted
Restrict Claude to collaborators, remove PR reviews
- Add author_association checks for OWNER/MEMBER/COLLABORATOR - Remove pull_request_review trigger (no auto-reviews) - Keep issues trigger for exploring new issues with @claude - Clean up unused configuration comments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 15e9df3 commit d40ae3d

1 file changed

Lines changed: 14 additions & 18 deletions

File tree

.github/workflows/claude.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,30 @@ on:
77
types: [created]
88
issues:
99
types: [opened, assigned]
10-
pull_request_review:
11-
types: [submitted]
1210

1311
jobs:
1412
claude:
1513
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+
)
2027
runs-on: ubuntu-latest
2128
permissions:
2229
contents: read
2330
pull-requests: read
2431
issues: read
2532
id-token: write
26-
actions: read # Required for Claude to read CI results on PRs
33+
actions: read
2734
steps:
2835
- name: Checkout repository
2936
uses: actions/checkout@v4
@@ -35,16 +42,5 @@ jobs:
3542
uses: anthropics/claude-code-action@v1
3643
with:
3744
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
4045
additional_permissions: |
4146
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

Comments
 (0)