diff --git a/tooling/backport-pr-to-patch-release.sh b/tooling/backport-pr-to-patch-release.sh index 52c1097c77b..adc25b4804b 100755 --- a/tooling/backport-pr-to-patch-release.sh +++ b/tooling/backport-pr-to-patch-release.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +# PATCH_RELEASE_NAME should be the name of the release that is being done without the patch number. (e.g. v1.2.x) PATCH_RELEASE_NAME=$1 PATCH_RELEASE_BRANCH=release/$PATCH_RELEASE_NAME PR_NUMBER=$2 @@ -11,7 +12,7 @@ PR_NUMBER=$2 # Check if no arguments are provided if [ $# -eq 0 ]; then echo "Usage: $0 " - echo ": v1.2.x or release/v1.2.x" + echo ": v1.2.x" echo ": PR number to backport" exit 1 fi @@ -20,9 +21,10 @@ if [ -z "$PATCH_RELEASE_NAME" ]; then echo "Patch release name is not provided: $0 " exit 1 fi -# Check patch release name starts with "release/" -if [[ ! "$PATCH_RELEASE_NAME" =~ ^release/.* ]]; then - PATCH_RELEASE_NAME="release/$PATCH_RELEASE_NAME" +# Check patch release name does not start with "release/" +if [[ "$PATCH_RELEASE_NAME" =~ ^release/.* ]]; then + echo "Patch release name should not be the same as the release branch name. Only include the release name without patch number. (e.g. v1.2.x)" + exit 1 fi # Check PR number is provided if [ -z "$PR_NUMBER" ]; then