Make parsing of components a bit more robust.

Suggested by @michael-simons
This commit is contained in:
Fabio Niephaus
2023-04-18 09:46:32 +02:00
parent 5f2753d6bc
commit babc303d7e
2 changed files with 6 additions and 2 deletions

View File

@@ -19,7 +19,9 @@ async function run(): Promise<void> {
const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, {required: true})
const componentsString: string = core.getInput(c.INPUT_COMPONENTS)
const components: string[] =
componentsString.length > 0 ? componentsString.split(',') : []
componentsString.length > 0
? componentsString.split(',').map(x => x.trim())
: []
const setJavaHome = core.getInput(c.INPUT_SET_JAVA_HOME) === 'true'
const cache = core.getInput(c.INPUT_CACHE)
const enableCheckForUpdates =