Skip to content

Commit 1ebc095

Browse files
committed
feat(release): add version override input to release workflow
Allow specifying an explicit version when triggering the release workflow, useful for retrying a half-failed publish where some packages were already published with the auto-computed version.
1 parent f383359 commit 1ebc095

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
options:
1212
- latest
1313
- alpha
14+
version:
15+
description: 'Override version (leave empty to auto-compute). Use when retrying a failed publish.'
16+
required: false
17+
default: ''
18+
type: string
1419

1520
permissions: {}
1621

@@ -31,11 +36,21 @@ jobs:
3136
with:
3237
fetch-depth: 0
3338
fetch-tags: true
39+
- name: Use override version
40+
if: ${{ inputs.version != '' }}
41+
id: override
42+
run: echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
43+
3444
- uses: ./.github/actions/set-snapshot-version
35-
id: version
45+
if: ${{ inputs.version == '' }}
46+
id: computed
3647
with:
3748
npm_tag: ${{ inputs.npm_tag }}
3849

50+
- name: Set final version
51+
id: version
52+
run: echo "version=${{ inputs.version != '' && steps.override.outputs.version || steps.computed.outputs.version }}" >> $GITHUB_OUTPUT
53+
3954
build-rust:
4055
runs-on: ${{ matrix.settings.os }}
4156
needs: prepare

0 commit comments

Comments
 (0)