Skip to content

Commit 02805ea

Browse files
add force release boolean input to workflow_dispatch
1 parent 0032ecb commit 02805ea

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
branches:
88
- main
99
workflow_dispatch:
10+
inputs:
11+
force:
12+
description: Force release regardless of version change
13+
type: boolean
14+
default: false
1015

1116
jobs:
1217
check-version:
@@ -22,12 +27,14 @@ jobs:
2227
- name: Check if version changed
2328
id: check
2429
run: |
25-
if git diff HEAD^ HEAD -- Cargo.toml | grep -q '^[+-]version = '; then
30+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.force }}" = "true" ]; then
31+
echo "changed=true" >> $GITHUB_OUTPUT
32+
elif git diff HEAD^ HEAD -- Cargo.toml | grep -q '^[+-]version = '; then
2633
echo "changed=true" >> $GITHUB_OUTPUT
2734
else
2835
echo "changed=false" >> $GITHUB_OUTPUT
2936
fi
30-
37+
3138
- name: Extract version
3239
id: extract
3340
if: steps.check.outputs.changed == 'true'
@@ -37,7 +44,7 @@ jobs:
3744
3845
build:
3946
needs: check-version
40-
if: needs.check-version.outputs.version_changed == 'true'
47+
if: needs.check-version.outputs.version_changed == 'true' || (github.event_name == 'workflow_dispatch' && inputs.force)
4148
strategy:
4249
matrix:
4350
include:

0 commit comments

Comments
 (0)