Skip to content

Commit 1bbf53c

Browse files
cliffhallclaude
andcommitted
ci: collapse author_association OR chains into contains(fromJSON(...))
Per review feedback on PR #1270: replace the three-way `==` OR chain in each of the four trigger branches with a single contains(fromJSON(...)) check against a shared list. Same semantics, less duplication, and the allowed-roles list is now defined once per branch instead of three times. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c044b5d commit 1bbf53c

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

.github/workflows/claude.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,16 @@ jobs:
1616
(
1717
(github.event_name == 'issue_comment' &&
1818
contains(github.event.comment.body, '@claude') &&
19-
(github.event.comment.author_association == 'OWNER' ||
20-
github.event.comment.author_association == 'MEMBER' ||
21-
github.event.comment.author_association == 'COLLABORATOR')) ||
19+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
2220
(github.event_name == 'pull_request_review_comment' &&
2321
contains(github.event.comment.body, '@claude') &&
24-
(github.event.comment.author_association == 'OWNER' ||
25-
github.event.comment.author_association == 'MEMBER' ||
26-
github.event.comment.author_association == 'COLLABORATOR')) ||
22+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
2723
(github.event_name == 'pull_request_review' &&
2824
contains(github.event.review.body, '@claude') &&
29-
(github.event.review.author_association == 'OWNER' ||
30-
github.event.review.author_association == 'MEMBER' ||
31-
github.event.review.author_association == 'COLLABORATOR')) ||
25+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
3226
(github.event_name == 'issues' &&
3327
(contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
34-
(github.event.issue.author_association == 'OWNER' ||
35-
github.event.issue.author_association == 'MEMBER' ||
36-
github.event.issue.author_association == 'COLLABORATOR'))
28+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association))
3729
)
3830
runs-on: ubuntu-latest
3931
permissions:

0 commit comments

Comments
 (0)