浏览代码

[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.
Mariusz Józala 3 月之前
父节点
当前提交
7c213baf4d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      .buildkite/scripts/run-pr-upgrade-tests.sh

+ 2 - 1
.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)