mirror of
https://github.com/reecetech/version-increment.git
synced 2025-12-21 14:35:44 +00:00
Merge pull request #15 from reecetech/pre-release
Expose the pre-release label as an output
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get next version
|
||||
uses: reecetech/version-increment@2022.2.4
|
||||
uses: reecetech/version-increment@2022.5.1
|
||||
id: version
|
||||
with:
|
||||
scheme: semver
|
||||
@@ -91,6 +91,7 @@ Examples:
|
||||
| major-version | Major number of the incremented version |
|
||||
| minor-version | Minor number of the incremented version |
|
||||
| patch-version | Patch number of the incremented version |
|
||||
| pre-release-label | Pre-release label of the incremented version |
|
||||
| major-v-version | Major number of the incremented version, prefixed with a `v` character |
|
||||
| minor-v-version | Minor number of the incremented version, prefixed with a `v` character |
|
||||
| patch-v-version | Patch number of the incremented version, prefixed with a `v` character |
|
||||
|
||||
@@ -41,6 +41,9 @@ outputs:
|
||||
patch-version:
|
||||
description: 'Patch number of the incremented version'
|
||||
value: ${{ steps.version-increment.outputs.patch-version }}
|
||||
pre-release-version:
|
||||
description: 'Pre-release label of the incremented version'
|
||||
value: ${{ steps.version-increment.outputs.pre-release-label }}
|
||||
major-v-version:
|
||||
description: 'Major number of the incremented version, prefixed with a `v` charatcter'
|
||||
value: ${{ steps.version-increment.outputs.major-v-version }}
|
||||
|
||||
@@ -74,7 +74,9 @@ fi
|
||||
|
||||
# add pre-release info to version if not the default branch
|
||||
if [[ "${current_ref}" != "refs/heads/${default_branch}" ]] ; then
|
||||
new_version="${new_version}-pre.${git_commit}"
|
||||
pre_release="pre.${git_commit}"
|
||||
new_version="${new_version}-${pre_release}"
|
||||
echo "::set-output name=pre-release-label::${pre_release}"
|
||||
fi
|
||||
|
||||
if [[ -z "$(echo "${new_version}" | ${grep} -P "${pcre_semver}")" ]] ; then
|
||||
|
||||
Reference in New Issue
Block a user