Skip to content

Commit 311e173

Browse files
authored
Adjust workflow triggers for Marvin (#3010)
1 parent fdc96f3 commit 311e173

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

.github/workflows/martian-issue-triage.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66

77
jobs:
88
martian-issue-triage:
9+
# For labeled events, verify the labeler is a repo member to prevent privilege escalation
910
if: |
10-
(github.event.action == 'opened' && github.actor == 'strawgate') ||
11-
(github.event.action == 'labeled' && github.event.label.name == 'triage-martian')
11+
(github.event.action == 'opened' && contains(fromJSON('["strawgate", "jlowin"]'), github.actor)) ||
12+
(github.event.action == 'labeled' && github.event.label.name == 'triage-martian' && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.sender.author_association))
1213
1314
concurrency:
1415
group: triage-martian-${{ github.event.issue.number }}

.github/workflows/marvin.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,22 @@ permissions:
1919

2020
jobs:
2121
marvin:
22+
# Restrict all triggers to repo members (OWNER, MEMBER, COLLABORATOR)
2223
if: |
23-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/marvin')) ||
24-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/marvin')) ||
25-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '/marvin')) ||
26-
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/marvin')) ||
27-
(github.event_name == 'issues' && contains(github.event.issue.body, '/marvin')) ||
28-
(github.event_name == 'discussion' && contains(github.event.discussion.body, '/marvin')) ||
29-
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '/marvin')) ||
30-
(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'Marvin Context Protocol') ||
31-
(github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'marvin')
24+
(
25+
(github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion_comment') &&
26+
contains(github.event.comment.body, '/marvin') &&
27+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
28+
) ||
29+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
30+
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)) ||
31+
(github.event_name == 'issues' && contains(github.event.issue.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association)) ||
32+
(github.event_name == 'discussion' && contains(github.event.discussion.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.discussion.author_association)) ||
33+
(
34+
github.event_name == 'issues' &&
35+
((github.event.action == 'assigned' && github.event.assignee.login == 'Marvin Context Protocol') || (github.event.action == 'labeled' && github.event.label.name == 'marvin')) &&
36+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.sender.author_association)
37+
)
3238
runs-on: ubuntu-latest
3339
steps:
3440
- uses: actions/checkout@v6

0 commit comments

Comments
 (0)