chore: dissallow 'v' in the version#655
Merged
Merged
Conversation
ef88ae5 to
c4d686d
Compare
avangelillo
reviewed
Jan 26, 2026
| elif [[ $1 == v* ]]; then | ||
| echo "Version should not start with 'v', e.g., use 3.1.4 instead of v3.1.4" | ||
| exit 1 | ||
| elif [[ ! $1 =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then |
Contributor
There was a problem hiding this comment.
Did this check not catch it? I always have too look up regex stuff, but is it just missing the start and end of string anchors?
Contributor
Author
There was a problem hiding this comment.
nope, it doesnt catch it right now -- i could change it to catch it though, that's probably simpler
Contributor
Author
There was a problem hiding this comment.
now we're using the anchors like you mention:
bash-5.3$ hi=v1.2.3
bash-5.3$ [[ ! $hi =~ [0-9]+\.[0-9]+\.[0-9]+ ]] && echo bad
bash-5.3$ [[ ! $hi =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo bad
bad
avangelillo
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Right now it's easy to accidentally change the version to
vX.X.X, instead ofX.X.X, this helps prevent that footgun.Motivation
Testing Guidelines
Additional Notes
Types of changes
Check all that apply