Skip to content

Commit 10832e5

Browse files
authored
Enhance npm publish workflow with custom_tag input
Added a custom_tag input for npm publish action to allow publishing with a specific dist-tag.
1 parent 4a1e1dc commit 10832e5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
required: false
1010
type: boolean
1111
default: false
12+
custom_tag:
13+
description: 'Publish with custom dist-tag only (e.g. 2.x). Does not set latest or next.'
14+
required: false
15+
type: string
1216

1317
permissions:
1418
id-token: write # Required for OIDC
@@ -42,7 +46,9 @@ jobs:
4246

4347
- name: Publish to npm
4448
run: |
45-
if [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
49+
if [ -n "${{ github.event.inputs.custom_tag }}" ]; then
50+
npm publish --access public --tag ${{ github.event.inputs.custom_tag }}
51+
elif [ "${{ github.event.inputs.prerelease }}" == "true" ]; then
4652
npm publish --access public --tag next
4753
else
4854
npm publish --access public

0 commit comments

Comments
 (0)