Skip to content

Commit 273c558

Browse files
dukecat0chrysle
andauthored
1.6.0: Add workflow_dispatch to release action (#1436)
* Add `workflow_dispatch` to release action * Update release.yml * Update .github/workflows/release.yml Co-authored-by: chrysle <96722107+chrysle@users.noreply.github.com> --------- Co-authored-by: chrysle <96722107+chrysle@users.noreply.github.com>
1 parent f27c3fc commit 273c558

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Release
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to release"
8+
required: true
9+
type: string
410
pull_request_target:
511
types:
612
- closed
@@ -15,6 +21,7 @@ jobs:
1521
create-tag:
1622
name: Create the Git tag
1723
if: >-
24+
github.event_name == 'workflow_dispatch' ||
1825
github.event.pull_request.merged == true
1926
&& contains(github.event.pull_request.labels.*.name, 'release-version')
2027
runs-on: ubuntu-latest
@@ -26,10 +33,13 @@ jobs:
2633
- uses: actions/checkout@v4
2734
- name: Extract version to be released
2835
id: get-version
29-
env:
30-
TITLE: ${{ github.event.pull_request.title }}
3136
run: |
32-
echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT"
37+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
38+
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
39+
else
40+
TITLE=${{ github.event.pull_request.title }}
41+
echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT"
42+
fi
3343
- name: Bump version and push tag
3444
uses: mathieudutour/github-tag-action@v6.2
3545
with:

0 commit comments

Comments
 (0)