diff --git a/buildkite/clone_repositories.sh b/buildkite/clone_repositories.sh index 22e75f2..651b41d 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 diff --git a/buildkite/origin_target_branch.sh b/buildkite/origin_target_branch.sh index 345fa92..296bc9b 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