Skip to content

Commit

Permalink
1.6.0: Add workflow_dispatch to release action (#1436)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
dukecat0 and chrysle authored Jun 2, 2024
1 parent f27c3fc commit 273c558
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Version to release"
required: true
type: string
pull_request_target:
types:
- closed
Expand All @@ -15,6 +21,7 @@ jobs:
create-tag:
name: Create the Git tag
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'release-version')
runs-on: ubuntu-latest
Expand All @@ -26,10 +33,13 @@ jobs:
- uses: actions/checkout@v4
- name: Extract version to be released
id: get-version
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT"
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT"
else
TITLE=${{ github.event.pull_request.title }}
echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT"
fi
- name: Bump version and push tag
uses: mathieudutour/github-tag-action@v6.2
with:
Expand Down

0 comments on commit 273c558

Please sign in to comment.