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

Accept default commit messages from npm version and yarn version #6

Open
mohsen1 opened this issue Feb 8, 2020 · 4 comments
Open

Comments

@mohsen1
Copy link

mohsen1 commented Feb 8, 2020

I use the default worflow of yarn for making a new release: yarn version --new-version patch

This makes a commit with message like v0.0.1

Currently I have to update the commit message to say Release v0.0.1 or change the configuration of this action.

Although very minor, it would be nice for that to simply work.

@pascalgn
Copy link
Owner

I think that would make sense, yes. Do you want to provide a PR? 😇

@rzr
Copy link

rzr commented Mar 5, 2020

But "npm version patch" commits without the v prefix like "0.0.1"

@Wakeful-Cloud
Copy link

I think the below expression may be helpful:

^v?(\d+\.\d+\.\d+(?:-(?:alpha|beta)\.\d+)?)$

Features:

  • v prefix is optional but supported
  • Supports alpha and beta commit messages but requires a numeric subfix (-alpha.0)
  • Strict (If something matches this Regex, it would probably make sense as a version name to a human)
Before After
v1.2.3 1.2.3
1.2.3 1.2.3
v11.12.13 11.12.13
11.12.13 11.12.13
11.12.13-alpha.10 11.12.13-alpha.10
v1.2.3-alpha.0 1.2.3-alpha.0
1.2.3-alpha.0 1.2.3-alpha.0
v1.2.3-beta.0 1.2.3-beta.0

Non matches:
x1.2.3, x1.2.3-gamma, x11.12.13, v1.2.3-alpha

You can find *unit* tests for it at https://regexr.com/589ii

@pascalgn Do you want me to make a PR for this Regex? If yes, do you want me to add unit tests with mocha/chai?

@pascalgn
Copy link
Owner

Yes, feel free to create a PR! Adding a unit test should be fine, too!

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

Successfully merging a pull request may close this issue.

4 participants