Skip to content

Commit 1c5ebe1

Browse files
committed
Fixed regex validation for version tag
1 parent 259b8b4 commit 1c5ebe1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ def validatetag(context: Context) -> None:
270270
git_tag = result.stdout.rstrip()
271271

272272
# Validate that the Git tag appears to be a valid version number
273-
ver_regex = re.compile(r'(\d+)\.(\d+)\.(\d+)(a|b|rc)(\d+)')
274-
match = ver_regex.fullmatch(git_tag)
275-
if match is None:
273+
ver_regex = re.compile(r'(\d+)\.(\d+)\.(\d+)((a|b|rc)(\d+))?')
274+
found = ver_regex.fullmatch(git_tag)
275+
if found is None:
276276
print(f'Tag {git_tag!r} does not appear to be a valid version number')
277277
sys.exit(-1)
278278
else:

0 commit comments

Comments
 (0)