Skip to content

Commit 9a34158

Browse files
committed
Check if on master when bumping versions
1 parent a898589 commit 9a34158

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

bump_version.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ fi
1818

1919
cd "$WORKTREE_ROOT"
2020

21+
# Ensure we are on the master branch
22+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
23+
if [ "$CURRENT_BRANCH" != "master" ]; then
24+
echo "Error: You must be on the master branch to bump the version. Current branch: $CURRENT_BRANCH" >&2
25+
exit 1
26+
fi
27+
2128
echo "Checking git status..."
2229
if ! git diff --quiet || ! git diff --cached --quiet; then
2330
echo "Working tree is not clean. Please commit or stash changes before running this script." >&2

0 commit comments

Comments
 (0)