From 7c213baf4d83b1e3f90fee9894f87433944ff94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20J=C3=B3zala?= <377355+jozala@users.noreply.github.com> Date: Fri, 27 Jun 2025 12:50:36 +0200 Subject: [PATCH] [CI] Correct the way merge base is identified (#130175) Without fetching, the local repository might be missing reference to the base branch, causing git merge-base to fail. --- .buildkite/scripts/run-pr-upgrade-tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.buildkite/scripts/run-pr-upgrade-tests.sh b/.buildkite/scripts/run-pr-upgrade-tests.sh index 1cbfdfc99152..14e659c08ee9 100644 --- a/.buildkite/scripts/run-pr-upgrade-tests.sh +++ b/.buildkite/scripts/run-pr-upgrade-tests.sh @@ -18,7 +18,8 @@ fi # Identify the merge base of the current commit (branch) and the base branch of the pull request. # PR upgrade tests are run from the merge base to the current commit. -BASE_COMMIT=$(git merge-base $BUILDKITE_PULL_REQUEST_BASE_BRANCH $BUILDKITE_COMMIT) +git fetch origin $BUILDKITE_PULL_REQUEST_BASE_BRANCH +BASE_COMMIT=$(git merge-base origin/$BUILDKITE_PULL_REQUEST_BASE_BRANCH $BUILDKITE_COMMIT) VERSION=$(sed -n 's/^elasticsearch[[:space:]]*=[[:space:]]*\(.*\)/\1/p' build-tools-internal/version.properties)