From a45cb6bf103b0734a988263507d3babb3009421c Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Fri, 6 Oct 2023 11:52:16 -0400 Subject: [PATCH] [buildkite] Fix backport PR pipeline generation (#100427) (cherry picked from commit f4d53bcc6102891374c670b61ed7d5b3ab5e47c3) --- .buildkite/scripts/pull-request/pipeline.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.buildkite/scripts/pull-request/pipeline.ts b/.buildkite/scripts/pull-request/pipeline.ts index c4e12f2aa48fe..a6a3df6ff2aff 100644 --- a/.buildkite/scripts/pull-request/pipeline.ts +++ b/.buildkite/scripts/pull-request/pipeline.ts @@ -116,7 +116,10 @@ export const generatePipelines = ( .filter((x) => x); if (!changedFiles?.length) { - const mergeBase = execSync(`git merge-base ${process.env["GITHUB_PR_TARGET_BRANCH"]} HEAD`, { cwd: PROJECT_ROOT }) + const mergeBase = execSync( + `git fetch origin ${process.env["GITHUB_PR_TARGET_BRANCH"]}; git merge-base origin/${process.env["GITHUB_PR_TARGET_BRANCH"]} HEAD`, + { cwd: PROJECT_ROOT } + ) .toString() .trim();