From 58c83414848011c0aab70ca8ed6d3fe3183e5b6f Mon Sep 17 00:00:00 2001 From: 20x-dz <113644268+20x-dz@users.noreply.github.com> Date: Thu, 22 Jun 2023 10:36:49 +0200 Subject: [PATCH 1/4] fix: check if options were passed as arguments (#68) before needlessly printing an error in the console, as an empty string is an invalid JSON string. --- index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index c87cad6..ae8f382 100644 --- a/index.js +++ b/index.js @@ -110,12 +110,15 @@ async function dep() { let verbosity = core.getInput('verbosity') let options = [] try { - for (let [key, value] in Object.entries(JSON.parse(core.getInput('options')))) { - options.push('-o', `${key}=${value}`) + let optionsArg = core.getInput('options') + if (optionsArg !== '') { + for (let [key, value] in Object.entries(JSON.parse(optionsArg))) { + options.push('-o', `${key}=${value}`) + } + } catch (e) { + console.error('Invalid JSON in options') + } } - } catch (e) { - console.error('Invalid JSON in options') - } try { await $`php ${dep} ${cmd} --no-interaction ${ansi} ${verbosity} ${options}` From 26fe6d39eb84bc7e034145e43cf6d3282e94ee1c Mon Sep 17 00:00:00 2001 From: 20x-dz <113644268+20x-dz@users.noreply.github.com> Date: Thu, 22 Jun 2023 10:37:24 +0200 Subject: [PATCH 2/4] feat: add support for specifying a recipe file path (#67) --- action.yaml | 5 +++++ index.js | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 74aadcb..fd694f6 100644 --- a/action.yaml +++ b/action.yaml @@ -48,6 +48,11 @@ inputs: default: '' description: Path to local Deployer binary. + recipe: + required: false + default: '' + description: Recipe file path. + ansi: required: false default: 'true' diff --git a/index.js b/index.js index ae8f382..b79dc71 100644 --- a/index.js +++ b/index.js @@ -106,6 +106,11 @@ async function dep() { } let cmd = core.getInput('dep').split(' ') + let recipe = core.getInput('recipe') + if (recipe !== '') { + recipe = `--file=${recipe}` + } + let ansi = core.getBooleanInput('ansi') ? '--ansi' : '--no-ansi' let verbosity = core.getInput('verbosity') let options = [] @@ -121,7 +126,7 @@ async function dep() { } try { - await $`php ${dep} ${cmd} --no-interaction ${ansi} ${verbosity} ${options}` + await $`php ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}` } catch (err) { core.setFailed(`Failed: dep ${cmd}`) } From 06aeb295d6432970d615c5551e3d941e50349c46 Mon Sep 17 00:00:00 2001 From: jan-tricks <113358501+jan-tricks@users.noreply.github.com> Date: Thu, 22 Jun 2023 13:20:39 +0200 Subject: [PATCH 3/4] corrected exclamation mark (#69) --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index b79dc71..389b2c6 100644 --- a/index.js +++ b/index.js @@ -117,13 +117,13 @@ async function dep() { try { let optionsArg = core.getInput('options') if (optionsArg !== '') { - for (let [key, value] in Object.entries(JSON.parse(optionsArg))) { - options.push('-o', `${key}=${value}`) - } - } catch (e) { - console.error('Invalid JSON in options') + for (let [key, value] in Object.entries(JSON.parse(optionsArg))) { + options.push('-o', `${key}=${value}`) } } + } catch (e) { + console.error('Invalid JSON in options') + } try { await $`php ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}` From 373ff336f748b8ef047aedaa3d51a1e14ce060bf Mon Sep 17 00:00:00 2001 From: Mohammed Elhaouari Date: Thu, 1 Feb 2024 20:28:00 +0100 Subject: [PATCH 4/4] Fix Node.js 16 actions deprecation warning (#79) --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index fd694f6..b610af2 100644 --- a/action.yaml +++ b/action.yaml @@ -64,7 +64,7 @@ inputs: description: Verbosity level Can be -v, -vv or -vvv. runs: - using: 'node16' + using: 'node20' main: 'index.js' branding: