This is an automated email from the ASF dual-hosted git repository.

hubcio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new 7316b09a5 fix(js): publish npm prereleases under a channel tag, not 
latest (#3370)
7316b09a5 is described below

commit 7316b09a52e121f776f0a1bed53c1ebaf644b756
Author: Hubert Gruszecki <[email protected]>
AuthorDate: Fri May 29 12:44:17 2026 +0200

    fix(js): publish npm prereleases under a channel tag, not latest (#3370)
---
 .github/actions/node-npm/post-merge/action.yml | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/.github/actions/node-npm/post-merge/action.yml 
b/.github/actions/node-npm/post-merge/action.yml
index 21d7534d1..3cf64fbbb 100644
--- a/.github/actions/node-npm/post-merge/action.yml
+++ b/.github/actions/node-npm/post-merge/action.yml
@@ -129,6 +129,20 @@ runs:
       run: |
         cd foreign/node
 
+        # npm publish defaults the dist-tag to `latest` for ANY version,
+        # including semver prereleases. An -edge/-rc build published under
+        # `latest` hijacks it from the stable release, so route prereleases
+        # to a channel tag derived from the prerelease identifier (edge, rc,
+        # ...) and reserve `latest` for stable versions.
+        VERSION="${{ inputs.version }}"
+        if [[ "$VERSION" == *-* ]]; then
+          pre="${VERSION#*-}"
+          DIST_TAG="${pre%%.*}"
+        else
+          DIST_TAG="latest"
+        fi
+        echo "npm dist-tag: $DIST_TAG"
+
         if [ "${{ inputs.dry_run }}" = "true" ]; then
           echo "🔍 Dry run - would publish to npm:"
           echo ""
@@ -158,11 +172,12 @@ runs:
           fi
 
           echo "📦 Publishing to npm registry..."
-          echo "Version: ${{ inputs.version }}"
+          echo "Version: $VERSION (dist-tag: $DIST_TAG)"
           echo ""
 
-          # Publish with provenance for supply chain security
-          npm publish --provenance --access public
+          # Publish with provenance for supply chain security. --tag keeps
+          # prereleases off `latest` (npm's default tag for any version).
+          npm publish --provenance --access public --tag "$DIST_TAG"
 
           if [ $? -eq 0 ]; then
             echo ""

Reply via email to