Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/model/versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class Versioning {
* Regex to parse version description into separate fields
*/
static get descriptionRegex() {
return /^v([\d.]+)-(\d+)-g(\w+)-?(\w+)*/g;
return /^v(\d[\w.]*)-(\d+)-g(\w+)-?(\w+)*/g;
}

static async determineVersion(strategy, inputVersion) {
Expand Down
11 changes: 9 additions & 2 deletions src/model/versioning.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,15 @@ describe('Versioning', () => {
expect(Versioning.descriptionRegex).toBeInstanceOf(RegExp);
});

test.each(['v1.1-1-g12345678', 'v0.1-2-g12345678', 'v0.0-500-gA9B6C3D0-dirty'])(
'is happy with valid %s',
test.each(
[
'v1.1-1-g12345678',
'v0.1-2-g12345678',
'v0.0-500-gA9B6C3D0-dirty',
'v0.0-500a-gA9B6C3D0-dirty',
'v0.1.0a-26-g6817b33',
'is happy with valid %s',
],
Copy link
Member

Choose a reason for hiding this comment

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

Here are some more test cases we should use:

2.0.0
2.0.0-rc.2
2.0.0-rc.1
1.0.0
1.0.0-beta

These are provided by https://semver.org/

(description) => {
expect(Versioning.descriptionRegex.test(description)).toBeTruthy();
},
Expand Down