From 26c106c3e4bb8d29874e81dc5cfc4a95d0c94081 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Tue, 1 Jul 2025 14:29:55 -0700 Subject: [PATCH] Allow prerelease using version bump action (#4318) --- .github/workflows/version-bump.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/version-bump.yaml b/.github/workflows/version-bump.yaml index b951fb7564..a5629db65b 100644 --- a/.github/workflows/version-bump.yaml +++ b/.github/workflows/version-bump.yaml @@ -8,10 +8,12 @@ on: required: true default: 'patch' type: 'choice' - options: - - patch - - minor - - major + options: [patch, minor, major, prepatch, preminor, premajor, prerelease] + pre_release: + description: Pre-release ID (suffix) + required: false + default: '' + type: string jobs: bump-version: @@ -37,15 +39,21 @@ jobs: NEW_VERSION=$(node -p "require('./package.json').version") echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT + - name: Format PR string + id: capitalised + run: | + CAPITALISED_TYPE=${{ github.event.inputs.version_type }} + echo "capitalised=${CAPITALISED_TYPE@u}" >> $GITHUB_OUTPUT + - name: Create Pull Request uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e with: token: ${{ secrets.PR_GH_TOKEN }} - commit-message: '[release] Bump version to ${{ steps.bump-version.outputs.NEW_VERSION }}' - title: '${{ steps.bump-version.outputs.NEW_VERSION }}' + commit-message: '[release] Increment version to ${{ steps.bump-version.outputs.NEW_VERSION }}' + title: ${{ steps.bump-version.outputs.NEW_VERSION }} body: | - Automated version bump to ${{ steps.bump-version.outputs.NEW_VERSION }} + ${{ steps.capitalised.outputs.capitalised }} version increment to ${{ steps.bump-version.outputs.NEW_VERSION }} branch: version-bump-${{ steps.bump-version.outputs.NEW_VERSION }} base: main labels: | - Release \ No newline at end of file + Release