diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c044863..14a7234 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,7 +84,6 @@ jobs: publish-npm: needs: upload-assets - if: ${{ secrets.NPM_TOKEN != '' }} runs-on: ubuntu-latest timeout-minutes: 10 permissions: @@ -101,6 +100,12 @@ jobs: cd npm npm version "$VERSION" --no-git-tag-version --allow-same-version - run: cd npm && npm test - - run: cd npm && npm publish --access public + - name: Publish to npm + run: | + if [ -z "$NODE_AUTH_TOKEN" ]; then + echo "NPM_TOKEN not set — skipping npm publish" + exit 0 + fi + cd npm && npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}