Try showing information about the scanned dependencies.

This commit is contained in:
Federico Builes
2022-09-22 16:49:45 +02:00
parent 2843194510
commit 723ec8c0d3

View File

@@ -12,6 +12,7 @@ import {getRefs} from './git-refs'
async function run(): Promise<void> {
try {
let failed = false
const config = readConfig()
const refs = getRefs(config, github.context)
@@ -23,7 +24,6 @@ async function run(): Promise<void> {
})
const minSeverity = config.fail_on_severity
let failed = false
const licenses = {
allow: config.allow_licenses,
@@ -69,6 +69,8 @@ async function run(): Promise<void> {
summary.addLicensesToSummary(licenseErrors, unknownLicenses, config)
printScannedDependencies(changes)
if (failed) {
core.setFailed('Dependency review detected vulnerable packages.')
} else {
@@ -150,4 +152,27 @@ function printNullLicenses(changes: Change[]): void {
}
}
function printScannedDependencies(changes: Change[]): void {
core.group('Dependency changes', async () => {
// group changes by manifest
const dependencies: Record<string, Change[]> = {}
for (const change of changes) {
if (dependencies[change.manifest] === undefined) {
dependencies[change.manifest] = []
}
dependencies[change.manifest].push(change)
}
for (const [manifestName, manifestChanges] of Object.entries(
dependencies
)) {
core.group(manifestName, async () => {
for (const change of manifestChanges) {
core.info(`${change.change_type} ${change.name}@${change.version}`)
}
})
}
})
}
run()