Skip to content

Commit 8dd8a84

Browse files
scripts/release.sh: ensure tree is clean before releasing (#3175)
Motivation: As part of the release process our script makes some changes to versions etc and then everything in the branch is committed. This is dangerous if there are uncommitted changes present. Modifications: As part of the release.sh script check if the tree has uncommitted changes and error out if it does.
1 parent 30b0e3d commit 8dd8a84

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/release.sh

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ if [ "$#" -ne "2" ]; then
5353
exit 1
5454
fi
5555

56+
if [ -n "$(git status --porcelain)" ]; then
57+
echo "Branch has uncommitted changes. Commit or revert any changes before releasing."
58+
exit 1
59+
fi
60+
5661
# Enforce JDK17 to get latest LTS javadoc format/features (search, etc.):
5762
java_version=$(./gradlew --no-daemon -version | grep 'Launcher JVM:' | \
5863
awk -F\. '{gsub(/Launcher JVM:[ \t]*/,"",$1); print $1"."$2}')

0 commit comments

Comments
 (0)