| version-source | A source of a CURRENT_VERSION, might be:
- file
- variable
| yes | variable |
| version | A version variable for version source | no | — |
| version-file | A path to a file with which holds a version | no | — |
| version-file-extraction-pattern | A RegEx to extract version from a version-source file. Should either match a full version, or return it as the
first group. E.G:
- '(?<=version=).+' - pattern match, e.g: 'version=5.0.3-SNAPSHOT' will extract matched string '5.0.3-SNAPSHOT'
- '"version":\s*"([^"]+)"' - group match, will extract the first group. e.g: '"version": "1.0.0",' to '1.0.0'
In case if there are groups in a pattern the first group will be extracted.
| no | .+ |
| release-version-cut-snapshot | Remove "SNAPSHOT" suffix from source version | no | true |
| release-version-cut-prerelease | Remove prerelease part from source version | no | false |
| release-version-cut-build-metadata | Remove build metadata suffix from source version | no | true |
| release-version-generate-build-metadata | Put build metadata (release date, commit sha, etc.) into result RELEASE_VERSION | no | false |
| release-version-build-metadata-pattern | Format pattern for build metadata. EG: "build.{date[YYYY-MM-dd]}.{hash[0, 6]}". It is also possible not to
customize variable outputs omitting square braces ([]) or even not to use any variables. Supported variables:
- date[date_format]: a current date in UTC or time set in 'release-version-build-metadata-datetime' variable.
Supports formatting included in square braces ([]). The date format will be applied by "Moment.js". Default format
is ['YYYY-MM-DD'].
Library: https://momentjs.com/
- hash[begin_index_inclusive, end_index_exclusive]: a commit hash, which triggered this build. You can shorten
the hash by specifying begin and end characters indexes included in square braces ([]), separated by a comma.
Default begin, end values are: [0, 8].
| no | build.{date}.{hash} |
| release-version-build-metadata-datetime | A time stamp in ISO format to put into a build metadata string, by default the action uses current time in UTC timezone | no | — |
| next-version-increment-major | Increment major version in result NEXT_VERSION, resets all other versions to "0" and prerelease to "1" if found | no | false |
| next-version-increment-minor | Increment minor version in result NEXT_VERSION, resets patch to "0" and prerelease to "1" if found | no | false |
| next-version-increment-patch | Increment patch version in result NEXT_VERSION, resets prerelease to "1" if found | no | false |
| next-version-increment-prerelease | Increment prerelease version in result NEXT_VERSION | no | false |
| next-version-cut-prerelease | Remove prerelease part from source version | no | false |
| next-version-cut-build-metadata | Remove build metadata suffix from source version | no | true |
| next-version-put-build-metadata | Put build metadata (release date, commit sha, etc.) into result NEXT_VERSION. Will be the same as for RELEASE_VERSION | no | false |
| data-extract | Enable data extraction mechanism.
Example:
data-extract: true
data-extract-name: 'first_variable'
data-extract-paths: '/path/to/file'
data-extract-patterns: '/(?<=variable.name=).+/i'
There are several use cases depending on RegEx format and flags:
* RegEx Match only - As on example, above. Variable name in 'data-extract-name' parameter will be used 'as is',
variable value will be set on matched text. Extraction will fail if 'data-extract-name' is not set.
* One group - Variable name in 'data-extract-name' parameter will be used 'as is', variable value will be set on
group value. Extraction will fail if 'data-extract-name' is not set.
* Two or more groups - If 'data-extract-name' value is set then the first group will be used as value, and other
groups will be ignored, if it's not set, then the first group will used as variable name and the second group
will be used as value.
* Multiple match (multiple RegEx, 'g' flag in RegEx is set, etc) - If 'data-extract-name' value is set the action
will extract all RegEx matches and export variables with underscore and variable index as suffix, except the
first one.
E.G.: first_variable -> FIRST_VARIABLE, FIRST_VARIABLE_1, etc; If 'data-extract-name' value is not set then
two groups in every RegEx is a requirement, the first group will used as variable name and the second group will
be used as value. If multiple files have the same variable names, output values will be overwritten with the
latter matches.
Variable name convert rules:
* Spaces and symbols '-', even multiple in a row, will be converted to single symbol '_';
* Other special characters except digits and letters will be cut off;
* The variable name will be converted to upper case.
| no | false |
| data-extract-name | Variable name to which extracted data will be placed, standard variable name conversion rules are also applied to
this field. If not set it will be extracted from RegEx groups. See usage use cases above.
| no | — |
| data-extract-paths | Semicolon (";") separated path list of files which to use to extract data | no | — |
| data-extract-patterns | Semicolon (";") separated RegEx pattern list wrapped with "/" symbols, with flags | no | — |