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
No known key found for this signature in database
GPG Key ID: F21CF5275F31DFD6
2 changed files with 6 additions and 2 deletions

4
dist/main/index.js generated vendored
View File

@ -71002,7 +71002,9 @@ function run() {
const gdsToken = core.getInput(c.INPUT_GDS_TOKEN);
const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, { required: true });
const componentsString = core.getInput(c.INPUT_COMPONENTS);
const components = componentsString.length > 0 ? componentsString.split(',') : [];
const components = 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 = core.getInput(c.INPUT_CHECK_FOR_UPDATES) === 'true';

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 =