File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 3
3
This action will take a release tag string as input and produce the following output:
4
4
5
5
1 . ` package-name ` : the name of the package, if set.
6
- 2 . ` package-version ` : the version string that was published (10.9.8) or (8.9.10-alpha ).
7
- 3 . ` package-version-suffix ` : the suffix part of the package- version.
6
+ 2 . ` package-version ` : the version string (10.9.8).
7
+ 3 . ` package-version-suffix ` : the prerelease suffix of the version tag
8
8
4 . ` prerelease ` : set to ` true ` if a version suffix (` -<something> ` ) is appended to the tag.
9
9
```
10
10
11
11
For example, the tag "my-package-v42.0.0-alpha.1 would return:
12
12
```
13
13
package-name: "my-package",
14
- package-version: "42.0.0-alpha.1 "
14
+ package-version: "42.0.0"
15
15
package-version-suffix: "-alpha.1"
16
16
prerelease: true
17
17
```
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ describe("parseReleaseTag", () => {
17
17
const parsedPrereleaseReleaseTag = parseReleaseTag ( prereleaseReleaseTag ) ;
18
18
expect ( parsedPrereleaseReleaseTag ) . deep . equal ( {
19
19
packageName : "my-package" ,
20
- packageVersion : "1.0.0-alpha.1 " ,
20
+ packageVersion : "1.0.0" ,
21
21
packageVersionSuffix : "-alpha.1" ,
22
22
prerelease : true ,
23
23
} ) ;
@@ -35,7 +35,7 @@ describe("parseReleaseTag", () => {
35
35
const parsedReleaseTagWithoutPackageWithSuffix = parseReleaseTag ( releaseTagWithoutPackageWithSuffix ) ;
36
36
expect ( parsedReleaseTagWithoutPackageWithSuffix ) . deep . equal ( {
37
37
packageName : undefined ,
38
- packageVersion : "1.0.0-alpha.1 " ,
38
+ packageVersion : "1.0.0" ,
39
39
packageVersionSuffix : "-alpha.1" ,
40
40
prerelease : true ,
41
41
} ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ type ParsedReleaseTag = {
6
6
} ;
7
7
8
8
export function parseReleaseTag ( releaseTag : string ) : ParsedReleaseTag {
9
- const releaseTagRegex = / ( ( [ a - z A - Z - ] * [ a - z A - Z ] ) - ) ? v ( [ 0 - 9 ] + \. [ 0 - 9 ] + \. [ 0 - 9 ] + ( - \S + ) ? ) / ;
9
+ const releaseTagRegex = / ( ( [ a - z A - Z - ] * [ a - z A - Z ] ) - ) ? v ( [ 0 - 9 ] + \. [ 0 - 9 ] + \. [ 0 - 9 ] ) + ( - \S + ) ? / ;
10
10
const result = releaseTagRegex . exec ( releaseTag ) ;
11
11
if ( ! result ) {
12
12
throw new Error ( `Invalid release tag: ${ releaseTag } ` ) ;
You can’t perform that action at this time.
0 commit comments