Skip to content

Commit 26c106c

Browse files
authored
Allow prerelease using version bump action (#4318)
1 parent d92c282 commit 26c106c

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

.github/workflows/version-bump.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ on:
88
required: true
99
default: 'patch'
1010
type: 'choice'
11-
options:
12-
- patch
13-
- minor
14-
- major
11+
options: [patch, minor, major, prepatch, preminor, premajor, prerelease]
12+
pre_release:
13+
description: Pre-release ID (suffix)
14+
required: false
15+
default: ''
16+
type: string
1517

1618
jobs:
1719
bump-version:
@@ -37,15 +39,21 @@ jobs:
3739
NEW_VERSION=$(node -p "require('./package.json').version")
3840
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
3941
42+
- name: Format PR string
43+
id: capitalised
44+
run: |
45+
CAPITALISED_TYPE=${{ github.event.inputs.version_type }}
46+
echo "capitalised=${CAPITALISED_TYPE@u}" >> $GITHUB_OUTPUT
47+
4048
- name: Create Pull Request
4149
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
4250
with:
4351
token: ${{ secrets.PR_GH_TOKEN }}
44-
commit-message: '[release] Bump version to ${{ steps.bump-version.outputs.NEW_VERSION }}'
45-
title: '${{ steps.bump-version.outputs.NEW_VERSION }}'
52+
commit-message: '[release] Increment version to ${{ steps.bump-version.outputs.NEW_VERSION }}'
53+
title: ${{ steps.bump-version.outputs.NEW_VERSION }}
4654
body: |
47-
Automated version bump to ${{ steps.bump-version.outputs.NEW_VERSION }}
55+
${{ steps.capitalised.outputs.capitalised }} version increment to ${{ steps.bump-version.outputs.NEW_VERSION }}
4856
branch: version-bump-${{ steps.bump-version.outputs.NEW_VERSION }}
4957
base: main
5058
labels: |
51-
Release
59+
Release

0 commit comments

Comments
 (0)