Skip to content

Commit d61e63a

Browse files
leogdionclaude
andcommitted
Fix GitHub Actions workflow permissions and security
- Add write permissions for pull-requests in claude-code-review.yml to enable comment posting - Add write permissions for contents, pull-requests, and issues in claude.yml - Restrict claude.yml workflow execution to authorized users (OWNER, MEMBER, COLLABORATOR) Addresses CodeRabbit review feedback on PR #35. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e430a9d commit d61e63a

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

.github/workflows/claude-code-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
permissions:
2323
contents: read
24-
pull-requests: read
24+
pull-requests: write
2525
issues: read
2626
id-token: write
2727

.github/workflows/claude.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,31 @@ on:
1313
jobs:
1414
claude:
1515
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')))
16+
(
17+
github.event_name == 'issue_comment' &&
18+
contains(github.event.comment.body, '@claude') &&
19+
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')
20+
) ||
21+
(
22+
github.event_name == 'pull_request_review_comment' &&
23+
contains(github.event.comment.body, '@claude') &&
24+
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')
25+
) ||
26+
(
27+
github.event_name == 'pull_request_review' &&
28+
contains(github.event.review.body, '@claude') &&
29+
(github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'COLLABORATOR')
30+
) ||
31+
(
32+
github.event_name == 'issues' &&
33+
(contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
34+
(github.event.issue.author_association == 'OWNER' || github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'COLLABORATOR')
35+
)
2036
runs-on: ubuntu-latest
2137
permissions:
22-
contents: read
23-
pull-requests: read
24-
issues: read
38+
contents: write
39+
pull-requests: write
40+
issues: write
2541
id-token: write
2642
actions: read # Required for Claude to read CI results on PRs
2743
steps:

0 commit comments

Comments
 (0)