-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #494 from actions/fix-purl-bug
Empty PURLs should not block the action from running
- Loading branch information
Showing
6 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,23 @@ test('it does not filter out changes that are on the exclusions list', async () | |
expect(invalidLicenses.forbidden.length).toEqual(0) | ||
}) | ||
|
||
test('it does not fail when the packages dont have a valid PURL', async () => { | ||
const emptyPurlChange = pipChange | ||
emptyPurlChange.package_url = '' | ||
|
||
const changes: Changes = [emptyPurlChange, npmChange, rubyChange] | ||
const licensesConfig = { | ||
allow: ['BSD'], | ||
licenseExclusions: ['pkg:pip/[email protected]', 'pkg:npm/[email protected]'] | ||
} | ||
|
||
const invalidLicenses = await getInvalidLicenseChanges( | ||
changes, | ||
licensesConfig | ||
) | ||
expect(invalidLicenses.forbidden.length).toEqual(1) | ||
}) | ||
|
||
test('it does filters out changes if they are not on the exclusions list', async () => { | ||
const changes: Changes = [pipChange, npmChange, rubyChange] | ||
const licensesConfig = { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters