Skip to content

Commit

Permalink
Proposal to support a different php binary (#82)
Browse files Browse the repository at this point in the history
* feat: Support different php binary.

* feat: Support different php binary.

---------

Co-authored-by: Nikolaj Stockholm <[email protected]>
  • Loading branch information
stockholmz and stockholmz authored May 7, 2024
1 parent 6242095 commit deec530
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
}
Expand Down

0 comments on commit deec530

Please sign in to comment.