From deec5306610537f816b96ce48b8854f4d2475e09 Mon Sep 17 00:00:00 2001 From: Nikolaj Stockholm Date: Tue, 7 May 2024 12:46:52 +0200 Subject: [PATCH] Proposal to support a different php binary (#82) * feat: Support different php binary. * feat: Support different php binary. --------- Co-authored-by: Nikolaj Stockholm --- README.md | 4 ++++ action.yaml | 5 +++++ index.js | 8 +++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d6c0c1..7f62e8e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ # `deploy all`. # Required. dep: deploy + + # The path to the PHP binary to use. + # Optional. + php-binary: "php" # Specifies a sub directory within the repository to deploy # Optional diff --git a/action.yaml b/action.yaml index b610af2..f69e11f 100644 --- a/action.yaml +++ b/action.yaml @@ -7,6 +7,11 @@ inputs: dep: required: true description: The command. + + php-binary: + required: false + default: '' + description: Path to PHP binary. sub-directory: required: false diff --git a/index.js b/index.js index ae4ad58..b50cc0b 100644 --- a/index.js +++ b/index.js @@ -124,9 +124,15 @@ async function dep() { } catch (e) { console.error('Invalid JSON in options') } + + let phpBin = 'php' + let phpBinArg = core.getInput('php-binary'); + if (phpBinArg !== '') { + phpBin = phpBinArg + } try { - await $`php ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}` + await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}` } catch (err) { core.setFailed(`Failed: dep ${cmd}`) }