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

unstableTagRegex isn't semver compliant #1276

Open
Rulqu opened this issue May 20, 2024 · 1 comment · May be fixed by #1277
Open

unstableTagRegex isn't semver compliant #1276

Rulqu opened this issue May 20, 2024 · 1 comment · May be fixed by #1277

Comments

@Rulqu
Copy link

Rulqu commented May 20, 2024

const unstableTagRegex = /.+-\w+\.\d+$/

This regex doesn't take into account that semver defines pre-release like this "A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version..." https://semver.org/#spec-item-9

Better regex could be like [1-9]\d*\.[1-9]\d*\.[1-9]\d*- so it still doesn't care about prefix but only about the hyphen after 3 numbers separated by dot.

My problem is that someone used semver compatible versioning with pre-releases as such:

v1.1.1-rc1-13
v1.1.1-rc1-14
v1.1.1-rc1-15

and the current regex doesn't catch this.

@dangreen
Copy link
Member

@Rulqu Hi. Feel free to open PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants