diff --git a/README.md b/README.md
index f19a3ab..f502f2f 100644
--- a/README.md
+++ b/README.md
@@ -42,13 +42,13 @@ For pre-release versions the commits on the current branch are used, and for rel
The action will increment the major version if it identifies any of the following patterns in the commit body or notes:
| Pattern | Examples |
-|------------------------------------|------------------------------------|
+| ---------------------------------- | ---------------------------------- |
| `/\+semver:\s*(breaking\|major)/i` | +semver:breaking, +semver:major |
| `/BREAKING CHANGES?:?/` | BREAKING CHANGE:, BREAKING CHANGES |
The action will increment the minor version if it identifies any of the following patterns in the commit body or notes:
| Pattern | Examples |
-|-----------------------------------|---------------------------------------------------|
+| --------------------------------- | ------------------------------------------------- |
| `/\+semver:\s*(feature\|minor)/i` | +semver:feature, +semver:minor |
| `/feat\([^)]*\):\s/` | feat(area): something, feat(): something |
| `/feature\([^)]*\):\s/` | feature(area): something, feature(): something |
@@ -60,7 +60,7 @@ If none of the previous patterns match, the action will increment the patch vers
## Inputs
| Parameter | Is Required | Default | Description |
-|--------------------------------|--------------------------------------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| ------------------------------ | ------------------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tag-prefix` | false | `v` | By default the action strips the prefixes off, but any value provided here will be prepended to the next calculated version.
GitHub indicates it is common practice to prefix your version names with the letter `v` (which is the default). If you do not want a prefix use `tag-prefix: none`. |
| `fallback-to-no-prefix-search` | false | `true` | Flag indicating whether it should fallback to a prefix-less search if no tags are found with the current prefix. Helpful when starting to use prefixes with tags. Accepted values: true\|false. |
| `calculate-prerelease-version` | false | `false` | Flag indicating whether to calculate a pre-release version rather than a release version. Accepts: `true\|false`. |
@@ -71,17 +71,23 @@ If none of the previous patterns match, the action will increment the patch vers
Each of the outputs are available as environment variables and as action outputs.
-| Output | Description |
-|--------------------------------|-----------------------------------------------------------------|
-| `NEXT_VERSION` | The next `major.minor.patch` version |
-| `NEXT_VERSION_NO_PREFIX` | The next `major.minor.patch` version without the tag prefix |
-| `NEXT_MINOR_VERSION` | The next `major.minor` version |
-| `NEXT_MINOR_VERSION_NO_PREFIX` | The next `major.minor` version without the tag prefix |
-| `NEXT_MAJOR_VERSION` | The next `major` version |
-| `NEXT_MAJOR_VERSION_NO_PREFIX` | The next `major` version without the tag prefix |
-| `NEXT_VERSION_SHA` | The SHA of the next version as an environment variable |
-| `PRIOR_VERSION` | The previous `major.minor.patch` version |
-| `PRIOR_VERSION_NO_PREFIX` | The previous `major.minor.patch` version without the tag prefix |
+| Output | Description |
+| -------------------------------------- | --------------------------------------------------------------------------------- |
+| `NEXT_VERSION` | The next `major.minor.patch` version |
+| `NEXT_VERSION_NO_PREFIX` | The next `major.minor.patch` version without the tag prefix |
+| `NEXT_MINOR_VERSION` | The next `major.minor` version |
+| `NEXT_MINOR_VERSION_NO_PREFIX` | The next `major.minor` version without the tag prefix |
+| `NEXT_MAJOR_VERSION` | The next `major` version |
+| `NEXT_MAJOR_VERSION_NO_PREFIX` | The next `major` version without the tag prefix |
+| `NEXT_VERSION_SHA` | The SHA of the next version as an environment variable |
+| `PRIOR_VERSION` | The previous `major.minor.patch` version |
+| `PRIOR_VERSION_NO_PREFIX` | The previous `major.minor.patch` version without the tag prefix |
+| `NEXT_VERSION_NOLABEL` | The next `major.minor.patch` version without pre-release label |
+| `NEXT_VERSION_NOLABEL_NO_PREFIX` | The next `major.minor.patch` version without the tag prefix and pre-release label |
+| `NEXT_MINOR_NOLABEL_VERSION` | The next `major.minor` version without pre-release label |
+| `NEXT_MINOR_VERSION_NOLABEL_NO_PREFIX` | The next `major.minor` version without the tag prefix and pre-release label |
+| `NEXT_MAJOR_NOLABEL_VERSION` | The next `major` version without pre-release label |
+| `NEXT_MAJOR_VERSION_NOLABEL_NO_PREFIX` | The next `major` version without the tag prefix and pre-release label |
## Breaking Changes
@@ -145,7 +151,7 @@ When creating PRs, please review the following guidelines:
This repo uses [git-version-lite] in its workflows to examine commit messages to determine whether to perform a major, minor or patch increment on merge if [source code] changes have been made. The following table provides the fragment that should be included in a commit message to active different increment strategies.
| Increment Type | Commit Message Fragment |
-|----------------|---------------------------------------------|
+| -------------- | ------------------------------------------- |
| major | +semver:breaking |
| major | +semver:major |
| minor | +semver:feature |
diff --git a/action.yml b/action.yml
index 79f2cbc..6df5544 100644
--- a/action.yml
+++ b/action.yml
@@ -52,6 +52,24 @@ outputs:
PRIOR_VERSION_NO_PREFIX:
description: 'The previous major.minor.patch version without the tag prefix.'
+ NEXT_VERSION_NOLABEL:
+ description: 'The calculated next version without pre-release label.'
+
+ NEXT_VERSION_NOLABEL_NO_PREFIX:
+ description: 'The calculated next version without the tag prefix and pre-release label.'
+
+ NEXT_MINOR_VERSION_NOLABEL:
+ description: 'The next major.minor version without pre-release label.'
+
+ NEXT_MINOR_VERSION_NOLABEL_NO_PREFIX:
+ description: 'The next major.minor version without the tag prefix and pre-release label.'
+
+ NEXT_MAJOR_VERSION_NOLABEL:
+ description: 'The next major version without pre-release label.'
+
+ NEXT_MAJOR_VERSION_NOLABEL_NO_PREFIX:
+ description: 'The next major version without the tag prefix and pre-release label.'
+
runs:
using: 'node20'
main: 'dist/index.js'
diff --git a/src/main.js b/src/main.js
index e3c7d79..952d2dc 100644
--- a/src/main.js
+++ b/src/main.js
@@ -61,11 +61,15 @@ async function run() {
console.log('version to build:');
console.log(versionToBuild);
- const { nextPatch, nextMinor, nextMajor, priorVersion } = versionToBuild;
+ const { nextPatch, nextMinor, nextMajor, priorVersion, nextPatchNoLabel, nextMinorNoLabel, nextMajorNoLabel } = versionToBuild;
setTheOutputs('PRIOR_VERSION', priorVersion, tagPrefix);
setTheOutputs('NEXT_VERSION', nextPatch, tagPrefix);
setTheOutputs('NEXT_MINOR_VERSION', nextMinor, tagPrefix);
setTheOutputs('NEXT_MAJOR_VERSION', nextMajor, tagPrefix);
+ setTheOutputs('NEXT_VERSION_NOLABEL', nextPatchNoLabel, tagPrefix);
+ setTheOutputs('NEXT_MINOR_VERSION_NOLABEL', nextMinorNoLabel, tagPrefix);
+ setTheOutputs('NEXT_MAJOR_VERSION_NOLABEL', nextMajorNoLabel, tagPrefix);
+
} catch (error) {
const versionTxt = calculatePrereleaseVersion ? 'pre-release' : 'release';
core.setFailed(
diff --git a/src/version.js b/src/version.js
index 57db2ed..09bb12e 100644
--- a/src/version.js
+++ b/src/version.js
@@ -163,7 +163,10 @@ function nextReleaseVersion(defaultReleaseType, tagPrefix, fallbackToNoPrefixSea
priorVersion: priorSemver.toString(),
nextPatch: nextSemver.toString(),
nextMinor: `${nextSemver.major}.${nextSemver.minor}`,
- nextMajor: `${nextSemver.major}`
+ nextMajor: `${nextSemver.major}`,
+ nextPatchNoLabel: nextSemver.toString(),
+ nextMinorNoLabel: `${nextSemver.major}.${nextSemver.minor}`,
+ nextMajorNoLabel: `${nextSemver.major}`
};
}
@@ -205,11 +208,15 @@ function nextPrereleaseVersion(label, defaultReleaseType, tagPrefix, fallbackToN
const priorSemver = new SemVer(priorReleaseVersion);
const nextSemver = new SemVer(prereleaseVersion);
+ const nextSemverNoLabel = new SemVer(nextReleaseVersion);
return {
priorVersion: priorSemver.toString(),
nextPatch: nextSemver.toString(),
nextMinor: `${nextSemver.major}.${nextSemver.minor}`,
- nextMajor: `${nextSemver.major}`
+ nextMajor: `${nextSemver.major}`,
+ nextPatchNoLabel: nextSemverNoLabel.toString(),
+ nextMinorNoLabel: `${nextSemverNoLabel.major}.${nextSemverNoLabel.minor}`,
+ nextMajorNoLabel: `${nextSemverNoLabel.major}`
};
}