From b02ba3c17359f43299a9df2ac0e478e9b543e390 Mon Sep 17 00:00:00 2001 From: Ugo Mignon <56931733+TartanLeGrand@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:02:40 +0200 Subject: [PATCH] feat(npm): add tag --- .github/workflows/publish-npm.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 0ccc430..e94e4c0 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -36,6 +36,11 @@ on: required: false default: 'production' type: string + tag: + description: 'NPM publish tag (e.g., latest, nightly)' + required: false + default: '' + type: string secrets: npm-token: description: 'NPM token for authentication' @@ -63,10 +68,15 @@ jobs: - name: Publish package run: | + TAG_OPTION="" + if [ -n "${{ inputs.tag }}" ]; then + TAG_OPTION="--tag ${{ inputs.tag }}" + fi + if [ "${{ inputs.provenance }}" = "true" ]; then - npm publish --access ${{ inputs.access }} --provenance + npm publish --access ${{ inputs.access }} $TAG_OPTION --provenance else - npm publish --access ${{ inputs.access }} + npm publish --access ${{ inputs.access }} $TAG_OPTION fi env: NODE_AUTH_TOKEN: ${{ secrets.npm-token }}