From 20d5f327f57cd1b16a92b410d3b89e73844e2697 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Tue, 12 Aug 2025 13:46:28 -0400 Subject: [PATCH] ci: fix inaccurate detect baseline script for benchmarks ls-remote will use the provided string as a pattern, so when checking if the '3.12' branch exists, it'll allow anything that contains '3.12' in the name. this change is more exacting by checking for a specific ref instead --- .gitlab/benchmarks/steps/detect-baseline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/benchmarks/steps/detect-baseline.sh b/.gitlab/benchmarks/steps/detect-baseline.sh index 2a6f40699b5..66efab4b4cf 100755 --- a/.gitlab/benchmarks/steps/detect-baseline.sh +++ b/.gitlab/benchmarks/steps/detect-baseline.sh @@ -27,7 +27,7 @@ elif [[ "${UPSTREAM_BRANCH}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then BASELINE_BRANCH=$(echo "${UPSTREAM_BRANCH:1}" | cut -d. -f1-2) # Check if a release branch exists or not - if git ls-remote --exit-code --heads origin "${BASELINE_BRANCH}" > /dev/null; then + if git ls-remote --exit-code --heads origin "refs/heads/${BASELINE_BRANCH}" > /dev/null; then echo "Found remote branch origin/${BASELINE_BRANCH}" else echo "Remote branch origin/${BASELINE_BRANCH} not found. Falling back to main."