Updating dist.

This commit is contained in:
Federico Builes
2022-11-15 07:50:53 +01:00
parent c57c602135
commit 2d265aa7cc
2 changed files with 19 additions and 5 deletions
Generated Vendored
+17 -3
View File
@@ -27505,7 +27505,13 @@ function validateLicenses(key, licenses) {
if (licenses === undefined) { if (licenses === undefined) {
return; return;
} }
const invalid_licenses = licenses.filter(license => !(0, utils_1.isSPDXValid)(license)); let invalid_licenses;
try {
invalid_licenses = licenses.filter(license => !(0, utils_1.isSPDXValid)(license));
}
catch (error) {
throw new Error(`Error validating license(s): ${error.message}`);
}
if (invalid_licenses.length > 0) { if (invalid_licenses.length > 0) {
throw new Error(`Invalid license(s) in ${key}: ${invalid_licenses.join(', ')}`); throw new Error(`Invalid license(s) in ${key}: ${invalid_licenses.join(', ')}`);
} }
@@ -27531,8 +27537,8 @@ function readConfigFile(filePath) {
return parseConfigFile(data); return parseConfigFile(data);
} }
catch (error) { catch (error) {
core.debug(error); core.debug(error.message);
throw new Error('Unable to fetch config file'); throw new Error('Unable to fetch or parse config file');
} }
}); });
} }
@@ -27541,8 +27547,16 @@ function parseConfigFile(configData) {
const data = yaml_1.default.parse(configData); const data = yaml_1.default.parse(configData);
for (const key of Object.keys(data)) { for (const key of Object.keys(data)) {
if (key === 'allow-licenses' || key === 'deny-licenses') { if (key === 'allow-licenses' || key === 'deny-licenses') {
const licenses = data[key];
// handle the case where the user has a singe or invalid license
// in the config file
if (typeof licenses === 'string') {
validateLicenses(key, [licenses]);
}
else {
validateLicenses(key, data[key]); validateLicenses(key, data[key]);
} }
}
// get rid of the ugly dashes from the actions conventions // get rid of the ugly dashes from the actions conventions
if (key.includes('-')) { if (key.includes('-')) {
data[key.replace(/-/g, '_')] = data[key]; data[key.replace(/-/g, '_')] = data[key];
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long