Skip to content

Commit e9fec49

Browse files
committed
security manager2
1 parent 333863a commit e9fec49

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

.cm/SecurityManager.cm

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,52 @@ automations:
99
- action: add-comment@v1
1010
args:
1111
comment: |
12-
PR: {{ pr | dump | safe }}
12+
comments: {{ pr.comments | dump | safe }}
1313

1414
Security_comment:
1515
if:
1616
- {{ jit.metrics.HIGH > 0 }}
17-
- {{ pr.conversations | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', term='This PR failed due to High severity vulnerability finding') | nope }}
17+
- {{ pr.conversations | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', term='This PR failed due to High severity vulnerability finding, if you don`t fix it please select:') | nope }}
1818
run:
1919
- action: add-comment@v1
2020
args:
2121
comment: |
22-
This PR failed due to High severity vulnerability finding, if you don`t fix it please select:
22+
This PR failed due to High severity vulnerability finding, if you don't fix it please select:
2323
- [ ] I need help with that fix.
2424
- [ ] I want to accept the risk, please approve.
2525
- [ ] This is false positive, please approve.
2626
- [ ] This is a test / simulator environment, please exclude.
2727

28-
Security_comment_response:
28+
Security_comment_need_help:
2929
if:
30-
- {{ pr.conversations | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', term='- [x] I need help with that fix.') | some}}
30+
- {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', term='- [x] I need help with that fix.') | some}}
3131
run:
3232
- action: add-label@v1
3333
args:
3434
label: "Fix pending"
3535

36+
Security_comment_accept_risk:
37+
if:
38+
- {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', term='- [x] I want to accept the risk, please approve.') | some}}
39+
run:
40+
- action: add-label@v1
41+
args:
42+
label: "Accept risk"
43+
44+
Security_comment_false_positive:
45+
if:
46+
- {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', term='- [x] This is false positive, please approve.') | some}}
47+
run:
48+
- action: add-label@v1
49+
args:
50+
label: "False positive"
51+
52+
Security_comment_test_env:
53+
if:
54+
- {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', term='- [x] This is a test / simulator environment, please exclude.') | some}}
55+
run:
56+
- action: add-label@v1
57+
args:
58+
label: "Test environment"
59+
3660
jit: {{ pr | extractJitFindings }}

0 commit comments

Comments
 (0)