mirror of
https://github.com/deployphp/action.git
synced 2025-07-19 22:05:15 +00:00
Add custom branch option
This commit is contained in:
parent
f60b28c08a
commit
e1198c3769
3 changed files with 19 additions and 7 deletions
|
@ -78,6 +78,10 @@
|
||||||
# You can specify the output verbosity level.
|
# You can specify the output verbosity level.
|
||||||
# Optional. Defaults to -v.
|
# Optional. Defaults to -v.
|
||||||
verbosity: -vvv
|
verbosity: -vvv
|
||||||
|
|
||||||
|
# The branch to deploy. Adds --branch=value to the deploy command.
|
||||||
|
# Optional.
|
||||||
|
branch: "main"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
|
@ -68,6 +68,11 @@ inputs:
|
||||||
default: '-v'
|
default: '-v'
|
||||||
description: Verbosity level Can be -v, -vv or -vvv.
|
description: Verbosity level Can be -v, -vv or -vvv.
|
||||||
|
|
||||||
|
branch:
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
description: The branch to deploy.
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|
5
index.js
5
index.js
|
@ -131,8 +131,11 @@ async function dep() {
|
||||||
phpBin = phpBinArg
|
phpBin = phpBinArg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let branch = core.getInput('branch')
|
||||||
|
let branchOption = branch !== '' ? `--branch=${branch}` : ''
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options}`
|
await $`${phpBin} ${dep} ${cmd} ${recipe} --no-interaction ${ansi} ${verbosity} ${options} ${branchOption}`
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.setFailed(`Failed: dep ${cmd}`)
|
core.setFailed(`Failed: dep ${cmd}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue