Skip to content

Commit 5a55454

Browse files
authored
change instructions for running cut-release-branch script (#6828)
update command
1 parent 708f2e6 commit 5a55454

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

release/cut-release-branch.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,26 @@ to the right script.
66
77
This script can be used to cut any branch on any repository
88
9-
For `pytorch/pytorch` usage would be like:
10-
> DRY_RUN=disabled cut-release-branch.sh
11-
12-
For `pytorch/builder`, `pytorch/test-infra` or domains usage would be like:
13-
> DRY_RUN=disabled GIT_BRANCH_TO_CUT_FROM=main RELEASE_VERSION=2.1 cut-release-branch.sh
9+
For `pytorch/test-infra` or domains usage would be like:
10+
> DRY_RUN=disabled GIT_BRANCH_TO_CUT_FROM=main RELEASE_VERSION={version} ./release/cut-release-branch.sh
1411
'
1512

1613
set -eou pipefail
17-
14+
RELEASE_VERSION=${RELEASE_VERSION:-""}
15+
if [[ ! RELEASE_VERSION ]]; then
16+
echo "RELEASE_VERSION is not set"
17+
exit 1
18+
fi
1819
GIT_TOP_DIR=$(git rev-parse --show-toplevel)
1920
GIT_REMOTE=${GIT_REMOTE:-origin}
20-
GIT_BRANCH_TO_CUT_FROM=${GIT_BRANCH_TO_CUT_FROM:-viable/strict}
21+
GIT_BRANCH_TO_CUT_FROM=${GIT_BRANCH_TO_CUT_FROM:-main}
2122

22-
# should output something like 1.11
23-
RELEASE_VERSION=${RELEASE_VERSION:-$(cut -d'.' -f1-2 "${GIT_TOP_DIR}/version.txt")}
23+
24+
RELEASE_VERSION=${RELEASE_VERSION:-""}
25+
if [[ ! RELEASE_VERSION ]]; then
26+
echo "RELEASE_VERSION is not set"
27+
exit 1
28+
fi
2429
TEST_INFRA_BRANCH=${TEST_INFRA_BRANCH:-"release/${RELEASE_VERSION}"}
2530

2631
DRY_RUN_FLAG="--dry-run"

0 commit comments

Comments
 (0)