semver-action
v1.0.0
Published
A Github Action that wil parse, validate and then provide data back on a SemVer version number.
Readme
semver-action
A Github Action that wil parse, validate and then provide data back on a SemVer version number.
This includes parsing out the major, minor, patch and the pre release aspects as well as providing next version numbers for the major, minor and patch for the provided version number.
Parameters
version: The version number to be parsed as a SemVer
Outputs
version: The parsed SemVer valuemajor: The major part of the parsed SemVer, e.g. for version1.2.3it would return1minor: The minor part of the parsed SemVer, e.g. for version1.2.3it would return2patch: The major part of the parsed SemVer, e.g. for version1.2.3it would return3isPreRelease: A boolean as a string indicating if the parsed SemVer is a pre release version, e.g. for version1.2.3it would returnfalse, but for1.2.3-alphait would return `truepreRelease: The pre release part of the parsed SemVer as a JSON array, e.g. for version1.2.3-alpha.1it would return["alpha", 1]preReleaseString: The pre release part of the parsed SemVer as a string, e.g. for version1.2.3-alpha.1it would returnalpha.1nextMajor: The next major version number as a string, e.g. for version1.2.3it would return2.0.0nextMinor: The next minor version number as a string, e.g. for version1.2.3it would return1.3.0nextPatch: The next patch version number as a string, e.g. for version1.2.3it would return1.2.4semeverData: The full JSON data structure of the parsed SemverData type
Usage
- name: Parse SemVer
id: version
uses: peter-murray/semver-action@v1
with:
version: 1.2.3-alpha.1
- name: Print next major
run: echo ${{ steps.version.outputs.nextMajor }}