Skip to content

Commit b7383f6

Browse files
committed
Add isPrerelease to output.
1 parent d2ce61f commit b7383f6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ This action was inspired by [latest-tag](https://github.com/EndBug/latest-tag) a
2525

2626
You should use this action in a workflow immediately after checkout. The following outputs will be set:
2727

28-
- `version`: version from package.json
29-
- `tags`: reverse sorted git tags in semver format
30-
- `nextVersion`: calculated next version (see table above)
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.
3133

3234
For inputs, the following options are available:
3335

34-
- `versionPrefix`: adds a string to the tag.
36+
- `tagPrefix` - adds a string to the `nextTag` (default: '').
3537

3638
Example yml:
3739

src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ async function run(): Promise<void> {
9191
console.log(`tags: ${tags}`);
9292

9393
const nextVersion = getNextVersion(version, tags);
94-
const prefix = core.getInput('versionPrefix') || '';
95-
core.setOutput('nextVersion', prefix + nextVersion);
94+
const tagPrefix = core.getInput('tagPrefix') || '';
95+
core.setOutput('nextVersion', nextVersion);
96+
core.setOutput('nextTag', tagPrefix + nextVersion);
97+
core.setOutput('isPrerelease', isPreRelease(new SemVer(nextVersion)));
9698
console.log(`nextVersion: ${nextVersion}`);
9799
} catch (error) {
98100
core.setFailed(error.message);

0 commit comments

Comments
 (0)