Format summary findings
This commit is contained in:
+11
-7
@@ -600,11 +600,15 @@ exports.addScannedDependencies = exports.addLicensesToSummary = exports.addChang
|
|||||||
const core = __importStar(__nccwpck_require__(2186));
|
const core = __importStar(__nccwpck_require__(2186));
|
||||||
const utils_1 = __nccwpck_require__(918);
|
const utils_1 = __nccwpck_require__(918);
|
||||||
function addSummaryToSummary(addedPackages, invalidLicenseChanges) {
|
function addSummaryToSummary(addedPackages, invalidLicenseChanges) {
|
||||||
core.summary.addHeading('Dependency Review').addRaw(`We found:
|
core.summary
|
||||||
- ${addedPackages.length} vulnerable package(s),\n
|
.addHeading('Dependency Review')
|
||||||
- ${invalidLicenseChanges.unresolved.length} package(s) with unprocessable licenses,\n
|
.addRaw('We found:')
|
||||||
- ${invalidLicenseChanges.forbidden.length} package(s) with incompatible licenses, and\n
|
.addList([
|
||||||
- ${invalidLicenseChanges.unlicensed.length} package(s) with unknown licenses.`);
|
`${addedPackages.length} vulnerable package(s)`,
|
||||||
|
`${invalidLicenseChanges.unresolved.length} package(s) with unprocessable licenses`,
|
||||||
|
`${invalidLicenseChanges.forbidden.length} package(s) with incompatible licenses and`,
|
||||||
|
`${invalidLicenseChanges.unlicensed.length} package(s) with unknown licenses.`
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
exports.addSummaryToSummary = addSummaryToSummary;
|
exports.addSummaryToSummary = addSummaryToSummary;
|
||||||
function addChangeVulnerabilitiesToSummary(addedPackages, severity) {
|
function addChangeVulnerabilitiesToSummary(addedPackages, severity) {
|
||||||
@@ -685,7 +689,7 @@ function addLicensesToSummary(invalidLicenseChanges, config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.summary.addQuote('No license violations detected.');
|
core.summary.addQuote('No incompatible license detected.');
|
||||||
}
|
}
|
||||||
core.debug(`found ${invalidLicenseChanges.unlicensed.length} unknown licenses`);
|
core.debug(`found ${invalidLicenseChanges.unlicensed.length} unknown licenses`);
|
||||||
if (invalidLicenseChanges.unlicensed.length > 0) {
|
if (invalidLicenseChanges.unlicensed.length > 0) {
|
||||||
@@ -711,7 +715,7 @@ function addScannedDependencies(changes) {
|
|||||||
const manifests = dependencies.keys();
|
const manifests = dependencies.keys();
|
||||||
const summary = core.summary
|
const summary = core.summary
|
||||||
.addHeading('Scanned Dependencies')
|
.addHeading('Scanned Dependencies')
|
||||||
.addRaw(`We scanned ${dependencies.size} manifest files:`);
|
.addHeading(`We scanned ${dependencies.size} manifest files:`, 'title');
|
||||||
for (const manifest of manifests) {
|
for (const manifest of manifests) {
|
||||||
const deps = dependencies.get(manifest);
|
const deps = dependencies.get(manifest);
|
||||||
if (deps) {
|
if (deps) {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+11
-9
@@ -7,13 +7,15 @@ export function addSummaryToSummary(
|
|||||||
addedPackages: Changes,
|
addedPackages: Changes,
|
||||||
invalidLicenseChanges: Record<string, Changes>
|
invalidLicenseChanges: Record<string, Changes>
|
||||||
): void {
|
): void {
|
||||||
core.summary.addHeading('Dependency Review').addRaw(
|
core.summary
|
||||||
`We found:
|
.addHeading('Dependency Review')
|
||||||
- ${addedPackages.length} vulnerable package(s),\n
|
.addRaw('We found:')
|
||||||
- ${invalidLicenseChanges.unresolved.length} package(s) with unprocessable licenses,\n
|
.addList([
|
||||||
- ${invalidLicenseChanges.forbidden.length} package(s) with incompatible licenses, and\n
|
`${addedPackages.length} vulnerable package(s)`,
|
||||||
- ${invalidLicenseChanges.unlicensed.length} package(s) with unknown licenses.`
|
`${invalidLicenseChanges.unresolved.length} package(s) with unprocessable licenses`,
|
||||||
)
|
`${invalidLicenseChanges.forbidden.length} package(s) with incompatible licenses and`,
|
||||||
|
`${invalidLicenseChanges.unlicensed.length} package(s) with unknown licenses.`
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addChangeVulnerabilitiesToSummary(
|
export function addChangeVulnerabilitiesToSummary(
|
||||||
@@ -122,7 +124,7 @@ export function addLicensesToSummary(
|
|||||||
core.summary.addTable([['Package', 'Version', 'License'], ...rows])
|
core.summary.addTable([['Package', 'Version', 'License'], ...rows])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
core.summary.addQuote('No license violations detected.')
|
core.summary.addQuote('No incompatible license detected.')
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(
|
core.debug(
|
||||||
@@ -162,7 +164,7 @@ export function addScannedDependencies(changes: Changes): void {
|
|||||||
|
|
||||||
const summary = core.summary
|
const summary = core.summary
|
||||||
.addHeading('Scanned Dependencies')
|
.addHeading('Scanned Dependencies')
|
||||||
.addRaw(`We scanned ${dependencies.size} manifest files:`)
|
.addHeading(`We scanned ${dependencies.size} manifest files:`, 'title')
|
||||||
|
|
||||||
for (const manifest of manifests) {
|
for (const manifest of manifests) {
|
||||||
const deps = dependencies.get(manifest)
|
const deps = dependencies.get(manifest)
|
||||||
|
|||||||
Reference in New Issue
Block a user