Skip to content

Commit

Permalink
Merge pull request #44 from PaloAltoNetworks/remove-duplicates
Browse files Browse the repository at this point in the history
Remove the duplicate CVE as a fix for the invalid SARIF files.
  • Loading branch information
sgordon46 authored Dec 7, 2023
2 parents dc36079 + 229955d commit cd5348a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14490,9 +14490,16 @@ function formatSarifToolDriverRules(results) {
const vulnerabilities = result.vulnerabilities;
const compliances = result.compliances;

const vulnerabilitiesFiltered = vulnerabilities.filter(
(thing, index, self) =>
index ===
self.findIndex((t) => t.id === thing.id )
);


let vulns = [];
if (vulnerabilities) {
vulns = vulnerabilities.map(vuln => {
if (vulnerabilitiesFiltered) {
vulns = vulnerabilitiesFiltered.map(vuln => {
return {
id: `${vuln.id}`,
shortDescription: {
Expand Down

0 comments on commit cd5348a

Please sign in to comment.