Skip to content

Commit deec530

Browse files
Nikolaj Stockholmstockholmz
andauthored
Proposal to support a different php binary (#82)
* feat: Support different php binary. * feat: Support different php binary. --------- Co-authored-by: Nikolaj Stockholm <info@nikolajstockholm.dk>
1 parent 6242095 commit deec530

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
# `deploy all`.
1919
# Required.
2020
dep: deploy
21+
22+
# The path to the PHP binary to use.
23+
# Optional.
24+
php-binary: "php"
2125

2226
# Specifies a sub directory within the repository to deploy
2327
# Optional

action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ inputs:
77
dep:
88
required: true
99
description: The command.
10+
11+
php-binary:
12+
required: false
13+
default: ''
14+
description: Path to PHP binary.
1015

1116
sub-directory:
1217
required: false

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,15 @@ async function dep() {
124124
} catch (e) {
125125
console.error('Invalid JSON in options')
126126
}
127+
128+
let phpBin = 'php'
129+
let phpBinArg = core.getInput('php-binary');
130+
if (phpBinArg !== '') {
131+
phpBin = phpBinArg
132+
}
127133

128134
try {
129-
await $`php ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
135+
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
130136
} catch (err) {
131137
core.setFailed(`Failed: dep ${cmd}`)
132138
}

0 commit comments

Comments
 (0)