From 82e0410353cf1233e2e1b07545fa492e874aded8 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Mon, 31 Jan 2022 21:55:08 +0100 Subject: [PATCH 1/2] Buildkite: Try same-named branches when cloning core repos, for PRs originating from official dlang repos --- buildkite/origin_target_branch.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildkite/origin_target_branch.sh b/buildkite/origin_target_branch.sh index 345fa923..296bc9b6 100755 --- a/buildkite/origin_target_branch.sh +++ b/buildkite/origin_target_branch.sh @@ -10,7 +10,12 @@ fi if [ $# -eq 2 ]; then origin_target_branch="$2" else - origin_target_branch="${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-$BUILDKITE_BRANCH}" + if [[ "${BUILDKITE_PULL_REQUEST_REPO:-}" =~ github\.com/dlang/ ]]; then + # PR from official dlang repo - try same-named branches for the other repos + origin_target_branch="$BUILDKITE_BRANCH" + else + origin_target_branch="${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-$BUILDKITE_BRANCH}" + fi fi if [ "$origin_target_branch" == "master" ] || [ "$origin_target_branch" == "stable" ] ; then From 8e3153dbd09ad7219478ffaeaa383cff4e46fb03 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Mon, 31 Jan 2022 22:15:57 +0100 Subject: [PATCH 2/2] [test] --- buildkite/clone_repositories.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/buildkite/clone_repositories.sh b/buildkite/clone_repositories.sh index 22e75f20..651b41d9 100755 --- a/buildkite/clone_repositories.sh +++ b/buildkite/clone_repositories.sh @@ -11,6 +11,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" origin_repo="$(echo "$BUILDKITE_REPO" | sed "s/.*\/\([^\]*\)[.]git/\1/")" echo "--- Cloning all core repositories" +echo "BUILDKITE_PULL_REQUEST_REPO='${BUILDKITE_PULL_REQUEST_REPO:-}'" repositories=(dmd druntime phobos tools dub) # For PRs to dlang/ci, clone itself too, s.t. the code below can be tested