diff --git a/push-tag.sh b/push-tag.sh index 3d5232315..9eedeed87 100755 --- a/push-tag.sh +++ b/push-tag.sh @@ -1,4 +1,13 @@ #!/bin/sh +if [ `git rev-parse --abbrev-ref HEAD` != "main" ]; then + echo "Error: Not on main branch. Please switch to main branch."; + exit 1; +fi +git pull +if ! git diff --quiet; then + echo "Error: Working directory is not clean. Please commit the changes first."; + exit 1; +fi export VERSION=`cat .version` echo Adding git tag with version v${VERSION}; git tag v${VERSION};