Show an error when disallowed dependencies show up.
This commit is contained in:
+4
-3
@@ -44,7 +44,8 @@ async function run(): Promise<void> {
|
|||||||
|
|
||||||
if (licenseErrors.length > 0) {
|
if (licenseErrors.length > 0) {
|
||||||
printLicensesError(licenseErrors, config.allow_licenses!)
|
printLicensesError(licenseErrors, config.allow_licenses!)
|
||||||
throw new Error('Dependency review detected incompatible licenses.')
|
core.setFailed('Dependency review detected incompatible licenses.')
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const change of filteredChanges) {
|
for (const change of filteredChanges) {
|
||||||
@@ -117,10 +118,10 @@ function printLicensesError(
|
|||||||
): void {
|
): void {
|
||||||
core.info('Dependency review detected incompatible licenses.')
|
core.info('Dependency review detected incompatible licenses.')
|
||||||
core.info('\nAllowed licenses: ' + allowLicenses.join(', ') + '\n')
|
core.info('\nAllowed licenses: ' + allowLicenses.join(', ') + '\n')
|
||||||
core.info('The following dependencies have incompatible licenses:')
|
core.info('The following dependencies have incompatible licenses:\n')
|
||||||
for (const change of changes) {
|
for (const change of changes) {
|
||||||
core.info(
|
core.info(
|
||||||
`${styles.bold.open}${change.manifest} » ${change.name}@${change.version}${styles.bold.close} – ${change.license}`
|
`${styles.bold.open}${change.manifest} » ${change.name}@${change.version}${styles.bold.close} – License: ${styles.color.red.open}${change.license}${styles.color.red.close}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user