Repository navigation
ci(nodejs): skip npm publish when the version is already published - #608
Merged
Merged
Conversation
npm refuses to publish over an existing version, so re-running the Release workflow (e.g. to retry another SDK's publish, as with the v5.2.1 Maven Central retry) failed publish-nodejs-sdk with E403 for every package. Check the main package version first, like the existing Maven Central / crates.io / PyPI guards, and skip the publish when it is already on npm. The main package is published last, so its presence means every platform package is published too.
Merged
hogan-yuan
added a commit
that referenced
this pull request
Oct 16, 2026
Release **v5.2.2**. Bumps workspace `5.2.1` → `5.2.2`. ### New since v5.2.1 - **Added:** attached (take-profit / stop-loss) orders gain bid/ask depth levels (longbridge/developers#1189). `SubmitAttachedParams` / `ReplaceAttachedParams` gain `profit_taker_depth_level` / `stop_loss_depth_level` (int32, valid when `activate_order_type` is `LIT`), and `AttachedOrderDetail` gains `limit_depth_level`. Across Rust, C, C++, Java, Node.js and Python (the Go SDK ships separately, openapi-go#132) (#607) ### Release pipeline (no SDK changes) - Java: bump `central-publishing-maven-plugin` to 0.12.0 so Maven Central accepts bundles built with Maven 3.10 (#606) - Node.js: skip npm publish when the version is already published, so re-running the Release workflow no longer fails with E403 (#608) - Lower the Linux gnu glibc baseline for the Node.js & Python SDKs (#609) Only `Cargo.toml` (workspace version + internal dep reqs) and `CHANGELOG.md` change. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Re-running the Release workflow on a version that is already on npm fails
publish-nodejs-sdk. npm refuses to publish over an existing version, so every package fails with:This happened in the v5.2.1 Maven Central retry (run 38549442368, job 115844279153). The npm packages were already complete from the first run. The other publishers already guard against this case: Maven Central and crates.io check the published version first, and PyPI uses
skip-existing. npm was the only one without a guard.Fix
Add a
Check if version already on npmstep that setsNPM_EXISTS, and gatePublishon it, mirroring the Maven Central step.longbridgepackage. It is published last, after every platform package, so if it exists, the whole set exists.npm viewprinted anything, not its exit code. Older npm versions exit 0 with empty output for a missing version.Verification
release.ymlparses as valid YAML.package.jsonwith each version:5.2.1→already on npm; skipping publish→NPM_EXISTS=true9.9.9→not found on npm; will publish→NPM_EXISTS=falsenodejs/package.jsongets the release version from the existingUpdate versionsstep (update_jssdk_version.mjs), which runs before the check.CI-only change; no CHANGELOG entry.
🤖 Generated with Claude Code