Merge pull request #116 from actions/unknown-licenses

Unknown licenses
This commit is contained in:
Federico Builes
2022-06-15 15:26:38 +02:00
committed by GitHub
4 changed files with 4 additions and 5 deletions
Generated Vendored
+1 -2
View File
@@ -86,7 +86,6 @@ function getDeniedLicenseChanges(changes, licenses) {
let unknown = []; let unknown = [];
for (const change of changes) { for (const change of changes) {
let license = change.license; let license = change.license;
// TODO: be loud about unknown licenses
if (license === null) { if (license === null) {
unknown.push(change); unknown.push(change);
continue; continue;
@@ -191,9 +190,9 @@ function run() {
let [licenseErrors, unknownLicenses] = (0, licenses_1.getDeniedLicenseChanges)(changes, licenses); let [licenseErrors, unknownLicenses] = (0, licenses_1.getDeniedLicenseChanges)(changes, licenses);
if (licenseErrors.length > 0) { if (licenseErrors.length > 0) {
printLicensesError(licenseErrors, licenses); printLicensesError(licenseErrors, licenses);
printNullLicenses(unknownLicenses);
core.setFailed('Dependency review detected incompatible licenses.'); core.setFailed('Dependency review detected incompatible licenses.');
} }
printNullLicenses(unknownLicenses);
if (failed) { if (failed) {
core.setFailed('Dependency review detected vulnerable packages.'); core.setFailed('Dependency review detected vulnerable packages.');
} }
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
-1
View File
@@ -26,7 +26,6 @@ export function getDeniedLicenseChanges(
for (const change of changes) { for (const change of changes) {
let license = change.license let license = change.license
// TODO: be loud about unknown licenses
if (license === null) { if (license === null) {
unknown.push(change) unknown.push(change)
continue continue
+2 -1
View File
@@ -59,10 +59,11 @@ async function run(): Promise<void> {
if (licenseErrors.length > 0) { if (licenseErrors.length > 0) {
printLicensesError(licenseErrors, licenses) printLicensesError(licenseErrors, licenses)
printNullLicenses(unknownLicenses)
core.setFailed('Dependency review detected incompatible licenses.') core.setFailed('Dependency review detected incompatible licenses.')
} }
printNullLicenses(unknownLicenses)
if (failed) { if (failed) {
core.setFailed('Dependency review detected vulnerable packages.') core.setFailed('Dependency review detected vulnerable packages.')
} else { } else {