31 lines
857 B
TypeScript
Raw Permalink Normal View History

import * as path from 'path'
2020-01-05 12:04:24 +01:00
import * as core from '@actions/core'
import * as validate from './validate'
2020-01-05 12:04:24 +01:00
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)
}
2020-01-05 12:04:24 +01:00
}
run()