Skip to content

Commit 8a82927

Browse files
tholenstcopybara-github
authored andcommitted
Add the option of making prereleases.
https://semver.org/spec/v2.0.0.html specifies how these look like. We allow just appending "-[0-9a-z]*". (So e.g we can add -pre0 to the version). Also change the regexes to actually require a "." instead of allowing an arbitrary character. PiperOrigin-RevId: 816701210 Change-Id: Ia55e89bb82d1084f6788699f620f1fed1da8549a
1 parent 6737b1e commit 8a82927

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kokoro/testutils/github_release_util.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ process_params() {
8484
readonly ACTION
8585

8686
VERSION="$2"
87-
if [[ ! "${VERSION}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then
88-
echo "ERROR: Invalid version format: expected MAJOR.MINOR.PATCH, got \
89-
${VERSION}" >&2
87+
if [[ ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9a-z]*)?$ ]]; then
88+
echo "ERROR: Invalid version format: expected MAJOR.MINOR.PATCH or MAJOR.MINOR.PATCH-pre, got \${VERSION}" >&2
9089
usage
9190
fi
9291
readonly VERSION

0 commit comments

Comments
 (0)