Skip to content

Commit e22a67b

Browse files
authored
Update Backport Script to not Accept Release Branch Name as Patch Release Name (#9053)
* Update backport-pr-to-patch-release.sh to not allow release branch name as patch release name * Update backport-pr-to-patch-release.sh
1 parent 3bc6acd commit e22a67b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tooling/backport-pr-to-patch-release.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
set -e
33

4+
# PATCH_RELEASE_NAME should be the name of the release that is being done without the patch number. (e.g. v1.2.x)
45
PATCH_RELEASE_NAME=$1
56
PATCH_RELEASE_BRANCH=release/$PATCH_RELEASE_NAME
67
PR_NUMBER=$2
@@ -11,7 +12,7 @@ PR_NUMBER=$2
1112
# Check if no arguments are provided
1213
if [ $# -eq 0 ]; then
1314
echo "Usage: $0 <patch-release-name> <pr-number>"
14-
echo "<patch-release-name>: v1.2.x or release/v1.2.x"
15+
echo "<patch-release-name>: v1.2.x"
1516
echo "<pr-number>: PR number to backport"
1617
exit 1
1718
fi
@@ -20,9 +21,10 @@ if [ -z "$PATCH_RELEASE_NAME" ]; then
2021
echo "Patch release name is not provided: $0 <patch-release-name> <pr-number>"
2122
exit 1
2223
fi
23-
# Check patch release name starts with "release/"
24-
if [[ ! "$PATCH_RELEASE_NAME" =~ ^release/.* ]]; then
25-
PATCH_RELEASE_NAME="release/$PATCH_RELEASE_NAME"
24+
# Check patch release name does not start with "release/"
25+
if [[ "$PATCH_RELEASE_NAME" =~ ^release/.* ]]; then
26+
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)"
27+
exit 1
2628
fi
2729
# Check PR number is provided
2830
if [ -z "$PR_NUMBER" ]; then

0 commit comments

Comments
 (0)