Skip to content

Commit

Permalink
fix: reject non-semver strings in release.sh
Browse files Browse the repository at this point in the history
Fail when the next version is specified as a non-semver string,
e.g. "minor" or "patch".

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
  • Loading branch information
bajtos committed Jul 10, 2024
1 parent e23eda5 commit 4a58217
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ git diff --quiet HEAD || (echo "please revert the uncommited changes"; exit 1)

SPARK_VERSION="${1?Missing required argument: semver}"

(echo "$SPARK_VERSION" | grep -Eq '^\d+\.\d+\.\d+$') || {
echo Invalid version string \'$SPARK_VERSION\'. Must be MAJOR.MINOR.PATCH
exit 1
}

sed -i '' -e "s/SPARK_VERSION = .*/SPARK_VERSION = '$SPARK_VERSION'/" lib/constants.js
git add lib/constants.js
git commit -m v"$SPARK_VERSION"
Expand Down

0 comments on commit 4a58217

Please sign in to comment.