Check namespaces when excluding license checks
The `allow-dependencies-licenses` option was not checking the namespace part of the PURL to make sure it matched.
This commit is contained in:
@@ -338,4 +338,15 @@ describe('GH License API fallback', () => {
|
|||||||
expect(mockOctokit.rest.licenses.getForRepo).not.toHaveBeenCalled()
|
expect(mockOctokit.rest.licenses.getForRepo).not.toHaveBeenCalled()
|
||||||
expect(unlicensed.length).toEqual(0)
|
expect(unlicensed.length).toEqual(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('it checks namespaces when doing exclusions', async () => {
|
||||||
|
const {unlicensed} = await getInvalidLicenseChanges([unlicensedChange], {
|
||||||
|
licenseExclusions: [
|
||||||
|
'pkg:githubactions/bar-org/actions-repo/.github/workflows/some-action.yml'
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(mockOctokit.rest.licenses.getForRepo).not.toHaveBeenCalled()
|
||||||
|
expect(unlicensed.length).toEqual(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ async function groupChanges(
|
|||||||
licenseExclusions.findIndex(
|
licenseExclusions.findIndex(
|
||||||
exclusion =>
|
exclusion =>
|
||||||
exclusion.type === changeAsPackageURL.type &&
|
exclusion.type === changeAsPackageURL.type &&
|
||||||
|
exclusion.namespace === changeAsPackageURL.namespace &&
|
||||||
exclusion.name === changeAsPackageURL.name
|
exclusion.name === changeAsPackageURL.name
|
||||||
) !== -1
|
) !== -1
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user