Skip to content

Commit 88478e2

Browse files
committed
Write permissions to claude action workflow.
Note that, besides the safeguards using `author_association` the action has guardrails against external users invoking it https://github.com/PeerDB-io/peerdb/actions/runs/24410304258/job/71304922306#step:3:198
1 parent 0d3beec commit 88478e2

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/claude.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ 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+
github.event.sender.type != 'Bot' &&
17+
(
18+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association) ||
19+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.review.author_association) ||
20+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.issue.author_association)
21+
) &&
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 == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
26+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
27+
)
2028
runs-on: ubuntu-latest
2129
permissions:
22-
contents: read
30+
contents: write
2331
pull-requests: write
2432
issues: write
2533
id-token: write

0 commit comments

Comments
 (0)