Add debug logs

This commit is contained in:
Jerome Prinet 2025-07-24 08:51:21 +02:00
parent aac6626d42
commit e48ea170d2
No known key found for this signature in database
GPG Key ID: 101BA71B2F530F0A
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,5 @@
import * as core from '@actions/core'
import * as find from './find'
import * as checksums from './checksums'
import * as hash from './hash'
@ -21,6 +23,16 @@ export async function findInvalidWrapperJars(
previouslyValidatedChecksums.includes(sha) ||
knownValidChecksums.checksums.has(sha)
) {
if (allowedChecksums.includes(sha)) {
core.info("Found allowed Gradle Wrapper JAR file: " + sha)
}
if (previouslyValidatedChecksums.includes(sha)) {
core.info(`Found previously validated Gradle Wrapper JAR file: ${sha}`)
}
if(knownValidChecksums.checksums.has(sha)) {
core.info(`Found known valid Gradle Wrapper JAR file: ${sha}`)
}
result.valid.push(new WrapperJar(wrapperJar, sha))
} else {
notYetValidatedWrappers.push(new WrapperJar(wrapperJar, sha))
@ -36,6 +48,7 @@ export async function findInvalidWrapperJars(
if (!fetchedValidChecksums.checksums.has(wrapperJar.checksum)) {
result.invalid.push(wrapperJar)
} else {
core.info(`Fall back - Found valid Gradle Wrapper JAR file: ${wrapperJar.checksum}`)
result.valid.push(wrapperJar)
}
}

View File

@ -17,7 +17,9 @@ export async function validateWrappers(
const allowedChecksums = process.env['ALLOWED_GRADLE_WRAPPER_CHECKSUMS']?.split(',') || []
const previouslyValidatedChecksums = checksumCache.load()
core.info(`gradleUserHome = ${gradleUserHome}`)
core.info(`Previously validated checksums loaded from cache: ${previouslyValidatedChecksums.join(', ')}`)
const result = await findInvalidWrapperJars(
workspaceRoot,
config.allowSnapshotWrappers(),