Skip to content

Commit b02ba3c

Browse files
feat(npm): add tag
1 parent 0698360 commit b02ba3c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/publish-npm.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ on:
3636
required: false
3737
default: 'production'
3838
type: string
39+
tag:
40+
description: 'NPM publish tag (e.g., latest, nightly)'
41+
required: false
42+
default: ''
43+
type: string
3944
secrets:
4045
npm-token:
4146
description: 'NPM token for authentication'
@@ -63,10 +68,15 @@ jobs:
6368

6469
- name: Publish package
6570
run: |
71+
TAG_OPTION=""
72+
if [ -n "${{ inputs.tag }}" ]; then
73+
TAG_OPTION="--tag ${{ inputs.tag }}"
74+
fi
75+
6676
if [ "${{ inputs.provenance }}" = "true" ]; then
67-
npm publish --access ${{ inputs.access }} --provenance
77+
npm publish --access ${{ inputs.access }} $TAG_OPTION --provenance
6878
else
69-
npm publish --access ${{ inputs.access }}
79+
npm publish --access ${{ inputs.access }} $TAG_OPTION
7080
fi
7181
env:
7282
NODE_AUTH_TOKEN: ${{ secrets.npm-token }}

0 commit comments

Comments
 (0)