Repository navigation
fix: recognize npm's real 'already published' error so publish is idempotent - #165
Merged
Merged
Conversation
…mpotent publish.mjs gated its idempotent already-published → pseudo-success path on the literal substring "Cannot publish over previously published version". npm's actual error is "You cannot publish over the previously published versions: 3.12.2." — lowercase `cannot`, an inserted `the`, and plural `versions` — so the substring never matched. The already-published case fell through to the 403/auth branch and FAILED the job. This is what red-X'd satellite/extra-package publishing on a re-run or a stray master push: those packages are intentionally not version-gated (so a partial satellite failure can be retried), so they reach the publish and must skip cleanly when the exact version already exists — but the broken match turned that skip into a hard failure (the reported slothlet-i18n / slothlet-types @3.12.2). Match the stable core phrase case-insensitively via a new tested pure helper `isVersionAlreadyPublishedError()`, with the real npm 403 body as a test fixture so the wording can't silently drift again.
Shinrai
approved these changes
Jul 28, 2026
Shinrai
added a commit
that referenced
this pull request
Jul 28, 2026
#169) ## 🚀 What's Changed ### 💥 Breaking Changes _No breaking changes_ ### ✨ Features _No new features_ ### 🐛 Bug Fixes - #166 - fix: measure coverage against a src-preserving build, not the dist-only one (658761a) - #165 - fix: recognize npm's real 'already published' error so publish is idempotent (fd92652) - #164 - fix: fail loudly when redirect-hotfix-pr can't run the cherry-pick path (d3af515) - #163 - fix: never auto-merge a Dependabot PR onto the release branch (20bd697) ### 📦 Dependencies _No dependency updates_ ### 🔧 Other Changes - #168 - docs(changelogs): flesh out v4.10.0 / v4.15.0 / v4.16.0 from commit diffs (b2e38f6) - docs(changelogs): backfill v4.3.0 through v4.16.0 (7dfe488) - #167 - docs: record why Dependabot subjects stay off the master-audit allow-list (9ff1016) - #164 - refactor: centralize release-flow workflows into workflow-*.yml reusables (67fa2d1) <details> <summary>👥 Contributors</summary> - @Shinrai </details> --------- Co-authored-by: Shinrai <[email protected]> Co-authored-by: Nathaniel H <[email protected]> Co-authored-by: cldmv-bot[bot] <230771808+cldmv-bot[bot]@users.noreply.github.com>
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.
🚀 What's Changed
💥 Breaking Changes
No breaking changes
✨ Features
No new features
🐛 Bug Fixes
📦 Dependencies
No dependency updates
🔧 Other Changes
No other changes
👥 Contributors