diff --git a/.buildkite/scripts/serverless/create_deploy_tag/create_fix_tag.sh b/.buildkite/scripts/serverless/create_deploy_tag/create_fix_tag.sh index ed1fab966ac49..ac302f43c9599 100755 --- a/.buildkite/scripts/serverless/create_deploy_tag/create_fix_tag.sh +++ b/.buildkite/scripts/serverless/create_deploy_tag/create_fix_tag.sh @@ -2,14 +2,14 @@ set -euo pipefail -echo "--- Verify $BUILDKITE_COMMIT exists in $BUILDKITE_BRANCH" +echo "--- Verify $BUILDKITE_COMMIT exists in origin/$BUILDKITE_BRANCH" # Step 1: Check if the commit is in the specific named branch -if git merge-base --is-ancestor $BUILDKITE_COMMIT $BUILDKITE_BRANCH; then +if git merge-base --is-ancestor $BUILDKITE_COMMIT origin/$BUILDKITE_BRANCH; then echo "Commit $BUILDKITE_COMMIT is part of the $BUILDKITE_BRANCH branch" # Step 2: Check if the commit is also part of any other branches # This command lists all branches containing the commit and counts them - branches_containing_commit=$(git branch --contains $BUILDKITE_COMMIT | wc -l) + branches_containing_commit=$(git branch -r --contains $BUILDKITE_COMMIT | wc -l) # If the commit is in more than one branch, exit with non-zero if [[ $branches_containing_commit -gt 1 ]]; then