Skip to content

Commit 20d5f32

Browse files
committed
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
1 parent ff7cc0e commit 20d5f32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.gitlab/benchmarks/steps/detect-baseline.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ elif [[ "${UPSTREAM_BRANCH}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
2727
BASELINE_BRANCH=$(echo "${UPSTREAM_BRANCH:1}" | cut -d. -f1-2)
2828

2929
# Check if a release branch exists or not
30-
if git ls-remote --exit-code --heads origin "${BASELINE_BRANCH}" > /dev/null; then
30+
if git ls-remote --exit-code --heads origin "refs/heads/${BASELINE_BRANCH}" > /dev/null; then
3131
echo "Found remote branch origin/${BASELINE_BRANCH}"
3232
else
3333
echo "Remote branch origin/${BASELINE_BRANCH} not found. Falling back to main."

0 commit comments

Comments
 (0)