@@ -25,11 +25,12 @@ This action was inspired by [latest-tag](https://github.com/EndBug/latest-tag) a
25
25
26
26
You should use this action in a workflow immediately after checkout. The following outputs will be set:
27
27
28
- - ` version ` - version from package.json
29
- - ` tags ` - reverse sorted git tags in semver format
30
- - ` nextVersion ` - calculated next version (see table above)
31
- - ` nextTag ` - calculated next version, prefixed (see below)
32
- - ` isPrerelease ` - true if pre-release, false otherwise.
28
+ - ` version ` - version in package.json
29
+ - ` tags ` - git tags in semver format
30
+ - ` nextVersion ` - computed next version (see table above)
31
+ - ` nextTag ` - computed next version, prefixed (see below)
32
+ - ` isBump ` - true if computed next version differs from version in package.json, false otherwise
33
+ - ` isPrerelease ` - true if pre-release, false otherwise
33
34
34
35
For inputs, the following options are available:
35
36
@@ -43,11 +44,16 @@ Example yml:
43
44
fetch-depth : 0
44
45
- name : Fetch next version
45
46
id : nextVersion
46
-
47
- - name : Log version and next version
47
+ uses :
VisualPinball/[email protected]
48
+ with :
49
+ tagPrefix : ' v'
50
+ - name : Log next version outputs
48
51
run : |
49
52
echo "${{ steps.nextVersion.outputs.version }}"
50
53
echo "${{ steps.nextVersion.outputs.nextVersion }}"
54
+ echo "${{ steps.nextVersion.outputs.nextTag }}"
55
+ echo "${{ steps.nextVersion.outputs.isBump }}"
56
+ echo "${{ steps.nextVersion.outputs.isPrerelease }}"
51
57
` ` `
52
58
53
59
**Note:** For this action to work properly, make sure to configure ` actions/checkout@v2` with a `fetch-depth: 0`.
@@ -79,7 +85,5 @@ $ npm test
79
85
√ should use major version from major package.json if no tag matched
80
86
√ should use pre-release version from pre-release package.json if no tag matched
81
87
√ should bump final version if tag already exists and ends with 0
82
- √ should throw an error if final version is already tagged and does not end with 0 (9ms)
83
- √ should throw an error if pre-release version is already tagged and does not end with 0
84
88
√ should throw an error for wrong versions (2ms)
85
89
` ` `
0 commit comments