Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add action to check tag/version string is semantic #263

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ModeSevenIndustrialSolutions
Copy link
Contributor

No description provided.

Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
@ModeSevenIndustrialSolutions
Copy link
Contributor Author


# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# See: https://regex101.com/r/Ly7O1x/3/
PATTERN="^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading over the linked semver docs I suspect you should be using the second regex listed in that section. grep does not support named capture groups even in PCRE mode from all the reading that I've done. It does, however, support numbered capture groups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants