From babc303d7e5b8f3062a94b90b49c3444cf291633 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Tue, 18 Apr 2023 09:46:32 +0200 Subject: [PATCH] Make parsing of components a bit more robust. Suggested by @michael-simons --- dist/main/index.js | 4 +++- src/main.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index 67f8245..6209cc7 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -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'; diff --git a/src/main.ts b/src/main.ts index c873a7c..6579716 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,7 +19,9 @@ async function run(): Promise { 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 =