mirror of
https://github.com/gradle/wrapper-validation-action.git
synced 2025-04-20 22:29:19 +08:00
31 lines
857 B
TypeScript
31 lines
857 B
TypeScript
import * as path from 'path'
|
|
import * as core from '@actions/core'
|
|
|
|
import * as validate from './validate'
|
|
|
|
export async function run(): Promise<void> {
|
|
try {
|
|
const minWrapperCount = +core.getInput('min-wrapper-count')
|
|
const allowSnapshots = core.getInput('allow-snapshots') === 'true'
|
|
const allowChecksums = core.getInput('allow-checksums').split(',')
|
|
const invalidWrapperJars = await validate.findInvalidWrapperJars(
|
|
path.resolve('.'),
|
|
minWrapperCount,
|
|
allowSnapshots,
|
|
allowChecksums
|
|
)
|
|
if (invalidWrapperJars.length > 0) {
|
|
const list = invalidWrapperJars.map(
|
|
invalid => `${invalid.checksum} ${invalid.path}`
|
|
)
|
|
core.setFailed(
|
|
`Found unknown Gradle Wrapper JAR files\n${list.join('\n- ')}`
|
|
)
|
|
}
|
|
} catch (error) {
|
|
core.setFailed(error.message)
|
|
}
|
|
}
|
|
|
|
run()
|