Skip to content

Commit

Permalink
Parse purls cautiously in getDeniedChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
juxtin committed Apr 26, 2024
1 parent 0659a74 commit a346092
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/deny.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ export async function getDeniedChanges(

let hasDeniedPackage = false
for (const change of changes) {
const changedPackage = PackageURL.fromString(change.package_url)
let changedPackage: PackageURL
try {
changedPackage = PackageURL.fromString(change.package_url)
} catch (error) {
core.error(`Error parsing package URL: ${error}`)
continue
}

for (const denied of deniedPackages) {
if (
Expand Down

0 comments on commit a346092

Please sign in to comment.