Fixing a bug with GHSA filtering.

Co-authored-by: Christine Nagadya <[email protected]>
This commit is contained in:
Federico Builes
2022-10-11 15:17:34 +02:00
co-authored by Christine Nagadya
parent 1d9bfbbddf
commit 2dd6c6a3d7
3 changed files with 19 additions and 10 deletions
+5 -2
View File
@@ -52,16 +52,19 @@ export function filterChangesByScopes(
}
/**
* Filter out changes that are allowed by the allow_ghsas config
* option. We want to remove these changes before we do any
* processing.
* @param ghsas - list of GHSA IDs to allow
* @param changes - list of changes to filter
* @returns a list of changes with the allowed GHSAs removed
*/
export function removeAllowedAdvisories(
export function filterAllowedAdvisories(
ghsas: string[] | undefined,
changes: Changes
): Changes {
if (ghsas === undefined) {
return []
return changes
}
const filteredChanges = changes.filter(change => {