From 56e7af68da87fc18cd025164277c502374367e6f Mon Sep 17 00:00:00 2001 From: Andy Palmer Date: Wed, 17 Aug 2022 14:46:44 +0100 Subject: [PATCH] Add ansi and verbosity input options (#42) --- README.md | 8 ++++++++ action.yaml | 10 ++++++++++ index.js | 4 +++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fab43df..b31a6f4 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,14 @@ # You can specify path to your local Deployer binary in the repo. # Optional. 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 diff --git a/action.yaml b/action.yaml index 7168981..f5496d3 100644 --- a/action.yaml +++ b/action.yaml @@ -32,6 +32,16 @@ inputs: default: '' 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: using: 'node12' main: 'index.js' diff --git a/index.js b/index.js index 843b7d2..efe01ba 100644 --- a/index.js +++ b/index.js @@ -81,8 +81,10 @@ async function 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.stderr.pipe(process.stderr)