From af44245d99bad9e31671fdaeb2405725a82736e5 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Mon, 24 Mar 2025 12:44:33 +0000 Subject: [PATCH] allow configuration of colors arg closes #72 --- action.yml | 5 +++++ phpunit-action.bash | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index a75ffd0..4dc9f2d 100644 --- a/action.yml +++ b/action.yml @@ -104,6 +104,10 @@ inputs: description: Generate code coverage report in PHPUnit XML format required: false + colors: + description: Use colors in output ("never", "auto" or "always") + default: auto + args: description: Extra arguments to pass to the phpunit binary required: false @@ -137,6 +141,7 @@ runs: ACTION_COVERAGE_PHP: ${{ inputs.coverage_php }} ACTION_COVERAGE_TEXT: ${{ inputs.coverage_text }} ACTION_COVERAGE_XML: ${{ inputs.coverage_xml }} + ACTION_COLORS: ${{ inputs.colors }} ACTION_ARGS: ${{ inputs.args }} id: phpunit_run diff --git a/phpunit-action.bash b/phpunit-action.bash index 9f88709..ce90419 100755 --- a/phpunit-action.bash +++ b/phpunit-action.bash @@ -151,7 +151,10 @@ then command_string+=(--coverage-xml "$ACTION_COVERAGE_XML") fi -command_string+=(--colors=always) +if [ -=n "$ACTION_COLORS" ] +then + command_string+=(--colors=$ACTION_COLORS) +fi if [ -n "$ACTION_ARGS" ] then