From 29a4c9e8ea0b1e28aee520e5b2de9b125f06da7d Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Thu, 8 Aug 2024 08:40:38 +0500 Subject: [PATCH] fix --- .github/workflows/publish-npm_v2.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-npm_v2.yaml b/.github/workflows/publish-npm_v2.yaml index 22f7695e..a7c63f95 100644 --- a/.github/workflows/publish-npm_v2.yaml +++ b/.github/workflows/publish-npm_v2.yaml @@ -31,13 +31,17 @@ jobs: - name: Determine NPM Tag id: determine-npm-tag run: | - VERSION_TAG="${{ github.event.inputs.version }}" + VERSION_TAG=${GITHUB_REF#refs/tags/v} if [[ $VERSION_TAG == *"-"* ]]; then - echo "NPM_TAG=${VERSION_TAG#*-}" >> $GITHUB_ENV + echo ::set-output name=NPM_TAG::${VERSION_TAG#*-} else - echo "NPM_TAG=latest" >> $GITHUB_ENV + echo ::set-output name=NPM_TAG::latest + fi + env: + GITHUB_REF: ${{ github.ref }} - name: Publish to NPM - run: yarn publish --new-version "${{ github.event.inputs.version }}" --tag "${{ env.NPM_TAG }}" --no-git-tag-version + run: yarn publish --new-version ${GITHUB_REF#refs/tags/v} --tag ${{ steps.determine-npm-tag.outputs.NPM_TAG }} --no-git-tag-version env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_REF: ${{ github.ref }}