From c6c2f029720bdfd7a9b5b7858d9e243a58179906 Mon Sep 17 00:00:00 2001 From: Jon Ryser <241263+jonryser@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:03:35 -0700 Subject: [PATCH] [test-python] Better syntax for github variables. --- .github/actions/test-python/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-python/action.yml b/.github/actions/test-python/action.yml index bd53a08..053c970 100644 --- a/.github/actions/test-python/action.yml +++ b/.github/actions/test-python/action.yml @@ -109,7 +109,7 @@ runs: else coverage_arg="" if [ ${{ inputs.min-coverage }} -gt 0 ]; then - coverage_arg="--cov-fail-under=${{ inputs.min-coverage }}" + coverage_arg="--cov-fail-under="${{ inputs.min-coverage }} fi pytest --cov --cov-report html -n auto $coverage_arg fi @@ -118,8 +118,11 @@ runs: - name: Get the coverage file. if: inputs.should-run-tests == 'yes' && inputs.upload-coverage == 'yes' run: | + coverage_prefix='' + if [ ${{ inputs.coverage-prefix }} != '' ]; then + coverage_prefix=${{ inputs.coverage-prefix }}- + fi coverage_branch=${${{ inputs.branch }}//+([\"\:<>|\*\?\\\/])/-} - coverage_prefix=${{ inputs.coverage-prefix != '' && "${{ inputs.coverage-prefix }}-" }} coverage_dir=${coverage_prefix}coverage-${coverage_branch} mkdir -p ${coverage_dir} && sudo cp -r coverage ${coverage_dir}