Repository navigation
fix: skip a version already published instead of failing the release - #331
Merged
Merged
Conversation
ignaciocapodanno
marked this pull request as ready for review
October 29, 2026 13:09
xdmnl
approved these changes
Oct 29, 2026
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.
Description
A release that already published cannot be re-run today. The npm step fails with
You cannot publish over the previously published versions, and because the GitHub Packages step runs after it in the same job, the mirror is skipped and never gets a chance.Each publish step now asks the registry it is about to publish to whether that version is already there, and skips it if so. Anything else still fails the job.
This unblocks 0.23.2, which is on npm but not on GitHub Packages. Re-running its release will skip npm and publish the mirror.
Links
Failed run
Risks and recovery
CI only, nothing in the published package changes. The check is scoped to one case, a version already present on that registry; credential, network and permission failures still fail the job as before. Reverting the commit is enough.
Checklist:
Testing
A workflow step cannot run outside Actions, so the registry checks were run locally against both real registries, each with the same npmrc its step builds:
0.23.2found, so it skips.9.9.9not found, so it publishes.0.23.0found, so it skips.0.23.1and0.23.2not found, so it publishes.That last line is the one that matters: re-running the 0.23.2 release will skip npm and publish the mirror.
Also checked that the workflow still parses and that both steps keep their
env.Not proven until this merges: that
yarn publishagainst GitHub Packages now succeeds. The repo was given write access to the package yesterday, and the mirror has not run since.