From 7d2887e3b9aa851c245ddd068158e3e898ac22bd Mon Sep 17 00:00:00 2001 From: Will Taylor Date: Fri, 29 Dec 2023 20:46:52 +0000 Subject: [PATCH] fix: surface arguments correctly --- badges/coverage.svg | 2 +- dist/index.js | 7 ++++--- src/main.ts | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/badges/coverage.svg b/badges/coverage.svg index cb1ae74..bf0e188 100644 --- a/badges/coverage.svg +++ b/badges/coverage.svg @@ -1 +1 @@ -Coverage: 15.21%Coverage15.21% \ No newline at end of file +Coverage: 14.89%Coverage14.89% \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index f791e6e..4b24f25 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6626,7 +6626,7 @@ function enumerateInputs() { if (key.startsWith('INPUT_')) { const inputName = key.slice('INPUT_'.length).toLowerCase(); const inputValue = process.env[key]; - if (inputName !== 'version') { + if (inputValue && inputName !== 'version') { inputs[inputName] = inputValue || ''; } } @@ -6673,11 +6673,12 @@ async function run() { core.addPath(pathToCLI); } const inputs = enumerateInputs(); - const args = Object.entries(inputs).map(([key, value]) => `${key}=${value}`); - core.info(`Running junit-reducer with arguments: `); + const args = Object.entries(inputs).map(([key, value]) => `--${key}='${value}'`); + core.startGroup(`Running junit-reducer with arguments: `); core.info(Object.entries(inputs) .map(([key, value]) => `${key}: ${value}`) .join('\n')); + core.endGroup(); await exec.exec('junit-reducer', args); } catch (error) { diff --git a/src/main.ts b/src/main.ts index 69cb967..4d6dfb8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,7 +13,7 @@ function enumerateInputs(): Record { if (key.startsWith('INPUT_')) { const inputName = key.slice('INPUT_'.length).toLowerCase() const inputValue = process.env[key] - if (inputName !== 'version') { + if (inputValue && inputName !== 'version') { inputs[inputName] = inputValue || '' } } @@ -78,15 +78,16 @@ export async function run(): Promise { const inputs = enumerateInputs() const args: string[] = Object.entries(inputs).map( - ([key, value]) => `${key}=${value}` + ([key, value]) => `--${key}='${value}'` ) - core.info(`Running junit-reducer with arguments: `) + core.startGroup(`Running junit-reducer with arguments: `) core.info( Object.entries(inputs) .map(([key, value]) => `${key}: ${value}`) .join('\n') ) + core.endGroup() await exec.exec('junit-reducer', args) } catch (error) {