From ab25b911ac9dbbdf9e48b07b2ee0232cb51013db Mon Sep 17 00:00:00 2001 From: Sven Grossmann Date: Mon, 28 Apr 2025 15:11:49 +0200 Subject: [PATCH] ci: move branch name to env var (#104633) * ci: move branch name to env var * quoting --- .github/actions/setup-grafana-bench/action.yml | 3 ++- .github/actions/test-coverage-processor/action.yml | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-grafana-bench/action.yml b/.github/actions/setup-grafana-bench/action.yml index 624ad243b7b..b708d862e2e 100644 --- a/.github/actions/setup-grafana-bench/action.yml +++ b/.github/actions/setup-grafana-bench/action.yml @@ -36,9 +36,10 @@ runs: shell: bash env: GH_TOKEN: ${{ steps.generate_token.outputs.token }} + BRANCH: ${{ inputs.branch }} run: | git clone https://x-access-token:${GH_TOKEN}@github.com/grafana/grafana-bench.git ../grafana-bench cd ../grafana-bench - git switch ${{ inputs.branch }} + git switch "$BRANCH" go install . diff --git a/.github/actions/test-coverage-processor/action.yml b/.github/actions/test-coverage-processor/action.yml index 7560031e846..c22fd0ccb19 100644 --- a/.github/actions/test-coverage-processor/action.yml +++ b/.github/actions/test-coverage-processor/action.yml @@ -28,11 +28,13 @@ runs: steps: - name: Process Go coverage output shell: bash + env: + COVERAGE_FILE: ${{ inputs.coverage-file }} run: | # Ensure valid coverage file even if empty - if [ ! -s ${{ inputs.coverage-file }} ]; then + if [ ! -s "$COVERAGE_FILE" ]; then echo "Coverage file is empty, creating a minimal valid file" - echo "mode: set" > ${{ inputs.coverage-file }} + echo "mode: set" > "$COVERAGE_FILE" fi - name: Report coverage to CodeCov