Skip to content

Commit 417e7df

Browse files
committed
fix(scripts): ensure release script is on correct branch
1 parent f9b5d95 commit 417e7df

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

hack/create-release-pr.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@
88
# - merge the PR
99
# It will trigger the release workflow that would create release draft on github
1010

11-
RELEASE_BRANCH="$(git rev-parse --abbrev-ref HEAD || true)"
1211
set -eux
1312
set -o pipefail
1413

14+
15+
CURRENT_BRANCH="$(git branch --show-current)"
16+
# CURRENT_BRANCH="release-0.14"
17+
18+
if [[ ! "$CURRENT_BRANCH" == release-* ]]; then
19+
echo "!! Please checkout branch 'release-X.Y' (currently in branch: '${CURRENT_BRANCH}')" >&2
20+
exit 1
21+
fi
22+
23+
RELEASE_BRANCH="${CURRENT_BRANCH}"
24+
1525
### look for latest on-branch tag
1626
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match "*${RELEASE_BRANCH##release-}*" 2>/dev/null || true)
1727

0 commit comments

Comments
 (0)