Add ansi and verbosity input options (#42)

This commit is contained in:
Andy Palmer 2022-08-17 14:46:44 +01:00 committed by GitHub
parent 0bf91d3ad5
commit 56e7af68da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

@ -51,6 +51,14 @@
# You can specify path to your local Deployer binary in the repo. # You can specify path to your local Deployer binary in the repo.
# Optional. # Optional.
deployer-binary: "bin/dep" deployer-binary: "bin/dep"
# You can choose to disable ANSI output.
# Optional. Defaults to true.
ansi: false
# You can specify the output verbosity level.
# Optional. Defaults to -v.
verbosity: -vvv
``` ```
## Example ## Example

@ -32,6 +32,16 @@ inputs:
default: '' default: ''
description: Path to local Deployer binary. description: Path to local Deployer binary.
ansi:
required: false
default: 'true'
description: Whether to enable ANSI output.
verbosity:
required: false
default: '-v'
description: Verbosity level Can be -v, -vv or -vvv.
runs: runs:
using: 'node12' using: 'node12'
main: 'index.js' main: 'index.js'

@ -81,8 +81,10 @@ async function dep() {
} }
let cmd = core.getInput('dep') let cmd = core.getInput('dep')
let ansi = core.getBooleanInput('ansi') ? '--ansi' : '--no-ansi';
let verbosity = core.getInput('verbosity');
let p = execa.command(`php ${dep} --no-interaction --ansi -v ${cmd}`) let p = execa.command(`php ${dep} --no-interaction ${ansi} ${verbosity} ${cmd}`)
p.stdout.pipe(process.stdout) p.stdout.pipe(process.stdout)
p.stderr.pipe(process.stderr) p.stderr.pipe(process.stderr)