Skip to content

Commit 546eaed

Browse files
committed
flter out ignored alerts
1 parent 89cf920 commit 546eaed

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

socketsecurity/core/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,8 +1317,14 @@ def add_package_alerts_to_collection(self, package: Package, alerts_collection:
13171317
url=package.url
13181318
)
13191319

1320-
if alert.type in self.config.security_policy:
1320+
# Use action from API (triage) if present, otherwise fall back to security policy
1321+
action = None
1322+
if hasattr(alert, 'action') and alert.action:
1323+
action = alert.action
1324+
elif alert.type in self.config.security_policy:
13211325
action = self.config.security_policy[alert.type]['action']
1326+
1327+
if action:
13221328
setattr(issue_alert, action, True)
13231329

13241330
if issue_alert.key not in alerts_collection:

0 commit comments

Comments
 (0)