From 7b22aa7bd095657e263a8b5c05de93f0842b29f1 Mon Sep 17 00:00:00 2001 From: Vasileios Naskos Date: Fri, 29 Nov 2024 13:57:17 +0100 Subject: [PATCH] Fix unknown variable on long lived branches --- .cirrus/sonarqube-cloud-analysis.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.cirrus/sonarqube-cloud-analysis.sh b/.cirrus/sonarqube-cloud-analysis.sh index c9a0b6bec..239648043 100644 --- a/.cirrus/sonarqube-cloud-analysis.sh +++ b/.cirrus/sonarqube-cloud-analysis.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -xeuo pipefail +set -xeo pipefail SONAR_PARAMS=( -k:"${CIRRUS_REPO_NAME}" @@ -14,15 +14,15 @@ SONAR_PARAMS=( -d:sonar.scanner.scanAll=false ) -if [ "$CIRRUS_BRANCH" == "master" ] && [ "$CIRRUS_PR" == "false" ]; then +if [ "$CIRRUS_BRANCH" == "master" ] && [ -z "$CIRRUS_PR" ]; then echo '======= Analyze master branch' dotnet sonarscanner begin "${SONAR_PARAMS[@]}" -elif [[ "$CIRRUS_BRANCH" == "branch-"* || "$CIRRUS_BRANCH" == "feature/"* ]] && [ "$CIRRUS_PR" == "false" ]; then +elif [[ "$CIRRUS_BRANCH" == "branch-"* || "$CIRRUS_BRANCH" == "feature/"* ]] && [ -z "$CIRRUS_PR" ]; then echo '======= Analyze long lived branch' dotnet sonarscanner begin "${SONAR_PARAMS[@]}" -d:sonar.branch.name="${CIRRUS_BRANCH}" -elif [ "$CIRRUS_PR" != "false" ]; then +elif [ -n "$CIRRUS_PR" ]; then echo '======= Analyze pull request' dotnet sonarscanner begin "${SONAR_PARAMS[@]}" \ -d:sonar.pullrequest.key="${CIRRUS_PR}" \