Skip to content

Commit 9f38c4d

Browse files
committed
Add workflow_dispatch to release workflow for manual triggering
1 parent aabc3c5 commit 9f38c4d

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ on:
66
- 'release-patch'
77
- 'release-minor'
88
- 'release-major'
9+
workflow_dispatch:
10+
inputs:
11+
bump_type:
12+
description: 'Version bump type'
13+
required: true
14+
type: choice
15+
options:
16+
- patch
17+
- minor
18+
- major
919

1020
permissions:
1121
contents: write
@@ -30,12 +40,16 @@ jobs:
3040
- name: Install zip utility
3141
run: sudo apt-get update && sudo apt-get install -y zip
3242

33-
- name: Extract bump type from tag
43+
- name: Extract bump type from tag or input
3444
id: bump
3545
run: |
36-
TAG_NAME=${GITHUB_REF#refs/tags/release-}
37-
echo "type=$TAG_NAME" >> $GITHUB_OUTPUT
38-
echo "Bump type: $TAG_NAME"
46+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
47+
BUMP_TYPE="${{ inputs.bump_type }}"
48+
else
49+
BUMP_TYPE=${GITHUB_REF#refs/tags/release-}
50+
fi
51+
echo "type=$BUMP_TYPE" >> $GITHUB_OUTPUT
52+
echo "Bump type: $BUMP_TYPE"
3953
4054
- name: Bump version in all files
4155
run: |

0 commit comments

Comments
 (0)