-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathvalidate-release.sh
More file actions
executable file
·30 lines (28 loc) · 1 KB
/
validate-release.sh
File metadata and controls
executable file
·30 lines (28 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# This script ensures that we don't accidentally cut the wrong kind of release on master or release branches
if [ "$#" -ne 2 ]
then
echo "Usage: validate-release.sh [major, minor, patch] branch"
echo "Example: validate-release.sh patch master"
exit 1
fi
if [ "$1" = "minor" ]; then
if [ "$2" = "master" ]; then
echo "Releasing a minor version on master, looks good!"
exit 0
else
echo "Can't release a minor version from a non-master branch! Please confirm the version you are releasing!!"
exit 1
fi
elif [ "$1" = "patch" ]; then
if [ "$2" = "master" ]; then
echo "Can't release a patch version from master branch! Please confirm the version you are releasing!!"
exit 1
else
echo "Releasing a patch version from a non-master branch, looks good!"
exit 0
fi
else
echo "Not sure what kind of release is happening. Please confirm that you are creating a minor release from master
or a patch from a release branch"
exit 1
fi