Skip to content

Commit

Permalink
Merge branch 'low'
Browse files Browse the repository at this point in the history
  • Loading branch information
colestrode committed Jul 29, 2021
2 parents 039f81f + 3c7b13a commit b6b7de0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dependabotAlerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ function getAlerts(repos) {
const mediumAlerts = alerts.filter(
(alert) => alert.severity === "moderate" && !alert.dismissed
);
const lowAlerts = alerts.filter(
(alert) => alert.severity === "low" && !alert.dismissed
);

// Dependabot calls these "moderate", but SparkPost categorizes these as "medium"
mediumAlerts.forEach((mediumAlert) => (mediumAlert.severity = "medium"));
Expand All @@ -39,12 +42,18 @@ function getAlerts(repos) {
});
summary["high"] = highAlerts.length;
}
if (mediumAlerts.length > 0 && (summary.critical || summary.high)) {
if (mediumAlerts.length > 0) {
mediumAlerts.forEach((alert) => {
blocks.push(buildBlocks(alert));
});
summary["medium"] = mediumAlerts.length;
}
if (lowAlerts.length > 0) {
lowAlerts.forEach((alert) => {
blocks.push(buildBlocks(alert));
});
summary["low"] = lowAlerts.length;
}
return { repo: name, summary, blocks };
});
}
Expand Down

0 comments on commit b6b7de0

Please sign in to comment.