You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not possible to verify the end to end publishing configuration without publishing
Proposed solution
[package manager] changeset publish --dry-run
Reacted by Mateusz Flisikowski, MirKml, Peter Siska, Auke ten Hoopen, steve-taylor-medirecords, Jonah Snider, Gábor Balogh, Aldo Velasco, Rafael, Titus Woo and 39 more
@Andarist It looks like #669 can resolve this issue, and has been open for a bit, is there any way that can be merged in? It looks like all of the concerns in the PR have been addressed, unless I missed something.
I'd like to understand the use case better before committing to this. What a dry run even is in this context? Could somebody write down what's the goal is and how it is different from calling changeset version?
I just wonder how you want to use this because changeset version already applies all of the updates on disk and it doesn't publish to the registry. So how this is different from changeset version? 🤔
changeset version and changset status outputting to JSON have covered most of my needs.
However, we occasionally have issues where the version on npm doesn't match the version in the repository. (Typically if something failed in the publish job after pushing to npm) If it's not cleaned up, then a subsequent publish will try to create the release again but will skip pushing to npm because the version already exists there.
I also haven't used the npm functionality, but perhaps a publish dry-run would be able to catch this?
Another small benefit would be validating the tag creation without actually pushing to npm.
@Andarist I guess this is more about publishing for me. I want to see a representation of what will be published to ensure everything is correct. I'm curious about the PR attached to this issue and whether people think it was the expected solution. #669 (comment)
I'm working in a very complex, very old, messy mono repo with a bundle and individual component packages. I'm debugging our versioning and tagging. This feature would be massively helpful for working through my issues with the confidence that I won't actually publish anything, but also get useful outputs to work against. I'll be looking into the workaround suggested above since it's not likely this will get adopted.
@Andarist, can you share your hesitation about adopting a widely available NPM feature? You mentioned an external contribution would be welcomed since you didn't have time to work on this; it's been four years.
I'd like to understand the use case better before committing to this. What a dry run even is in this context?
I think it likely shares the same purpose as the other CLI packages' --dry-run flag: to verify that changeset publish works without actually publishing to NPM.
My use case is that I'm adding changesets to a repository and want to verify that changeset publish works during the CI. However, I don't want to verify by publishing to NPM.
Could somebody write down what's the goal is and how it is different from calling changeset version?
It would differ from the changeset version because what I want is to verify if "NPM publish" worked, not "versioning the packages" worked.
I'm currently in need of this option. I am running into an issue where the calls to npm info from publish are getting an inconsistent E401. The token seems fine and different packages each time trigger the error with some having worked fine the previous attempt.
I had thought this was changset version so I commented out my call to publish but now there's no npm info calls at all. Without doing a full run of PR to make changes to my github workflows, auto run changsets to create a release PR, and then manually run my release workflow. I cannot test what I need to and have no clue why the initial issue is happening.
Just to be clear, adding to the comments, a dry run would also run validations, specially around authorisation -- does the npm auth token you're using work? This is very helpful when setting up CI.
In my case we're configuring it to publish internal packages into GitHub's package registry using a GitHub App's token. Similar to others in this thread, I'd like to test my workflow without actually publishing it first.
Hi, I would like to provide a use case. We use TeamCity at my workplace instead of Github actions, however we have a similar build and release flow as recommended in the docs.
We allow the creation of pre-release packages and publish them using pnpm changeset publish
There is a race condition:
We merge a release branch to main which has bumped package.json version, updated changelogs
A build queues to publish those packages
A PR with a new changeset is raised
The PR build runs first
It identifies packages to publish as pre-release packages
It publishes with a pre-release version and a prXXX tag.
The issue is that we use the pnpm changeset publish command and the outcome in this situation is this:
Packages that are pre-release get published with a pre-release version: [email protected]
and tag package1@PRXXX
Packages that are missing from our remote repository are ALSO published, but with a pre-release tag (not latest which is our saving grace) [email protected] package2@PRXXX
The issue is that this publish happened in our PR build which is not designed to then do further work like creating github releases.
The main build that would have published these will identify that they were already published and will skip publishing with the latest tag and creating github releases etc because it assumes that that work must have already been done if the package already exists in our repository.
Our current use case is to be able to detect if the PR build will over publish and fail fast or take alternative action.
In hindsight, one might consider this behaviour to simply be a bug. changeset publish should specify exactly what packages it wants to publish and not attempt to publish anything else as default behaviour.
@Andarist I found a workaround which was to directly call pnpm -r publish --dry-run --json and parse the output before running any changeset steps (ensuring it is clean before starting).
That said, this blocks the pipeline (albeit a minor, easy to resolve block) which is not ideal.
What package managers do you officially support? I found that at least with pnpm, you can use --filter and name the packages that you want to publish and it will not publish anything else. This would allow the build to run without race conditions or blocks. I can create a new issue for this if it helps?
Activity
Andarist commentedon Oct 10, 2021
This is a very good idea - I've actually lately created a duplicate of this issue: #645
I probably won't have time to work on this at the moment though. An implementation provided by the community would be awesome.
dkozma commentedon Feb 28, 2024
@Andarist It looks like #669 can resolve this issue, and has been open for a bit, is there any way that can be merged in? It looks like all of the concerns in the PR have been addressed, unless I missed something.
denbite commentedon Apr 24, 2025
just wanted to drop a note here since this PR has been open for quite a while and it doesn’t look like it’s getting merged anytime soon
for anyone looking for a workaround to simulate a dry run in the meantime, here’s a solution that’s worked for me
this command will create a
sim.jsonfile like the following{ "changesets": [ { "releases": [ { "name": "pkg-a", "type": "major" }, { "name": "pkg-b", "type": "minor" } ], "summary": "Description", "id": "rotten-flies-butter" } ], "releases": [ { "name": "pkg-a", "type": "major", "oldVersion": "1.3.1", "changesets": [ "rotten-flies-butter" ], "newVersion": "2.0.0" }, { "name": "pkg-b", "type": "minor", "oldVersion": "1.6.8", "changesets": [ "rotten-cases-dance" ], "newVersion": "1.7.0" } ] }hope this helps someone 👌
raypatterson commentedon Apr 25, 2025
I've been using verdaccio
Andarist commentedon Apr 25, 2025
I'd like to understand the use case better before committing to this. What a dry run even is in this context? Could somebody write down what's the goal is and how it is different from calling
changeset version?raypatterson commentedon Apr 25, 2025
Thanks for the question and all the work on this tool @Andarist !
The dry run reports what will happen without actually doing anything.
Maybe this PR from the beachball tool could be a point of reference?
shakiba commentedon Apr 25, 2025
Use case: similar to npm publish dry-run, to validate what would be published without actually publishing.
Andarist commentedon Apr 25, 2025
I just wonder how you want to use this because
changeset versionalready applies all of the updates on disk and it doesn't publish to the registry. So how this is different fromchangeset version? 🤔cjpearson commentedon Apr 25, 2025
changeset versionandchangset statusoutputting to JSON have covered most of my needs.However, we occasionally have issues where the version on npm doesn't match the version in the repository. (Typically if something failed in the publish job after pushing to npm) If it's not cleaned up, then a subsequent publish will try to create the release again but will skip pushing to npm because the version already exists there.
I also haven't used the npm functionality, but perhaps a publish dry-run would be able to catch this?
Another small benefit would be validating the tag creation without actually pushing to npm.
raypatterson commentedon Apr 25, 2025
@Andarist I guess this is more about publishing for me. I want to see a representation of what will be published to ensure everything is correct. I'm curious about the PR attached to this issue and whether people think it was the expected solution. #669 (comment)
caseyisonit commentedon May 7, 2025
I'm working in a very complex, very old, messy mono repo with a bundle and individual component packages. I'm debugging our versioning and tagging. This feature would be massively helpful for working through my issues with the confidence that I won't actually publish anything, but also get useful outputs to work against. I'll be looking into the workaround suggested above since it's not likely this will get adopted.
@Andarist, can you share your hesitation about adopting a widely available NPM feature? You mentioned an external contribution would be welcomed since you didn't have time to work on this; it's been four years.
devjiwonchoi commentedon May 11, 2025
I think it likely shares the same purpose as the other CLI packages'
--dry-runflag: to verify thatchangeset publishworks without actually publishing to NPM.My use case is that I'm adding changesets to a repository and want to verify that
changeset publishworks during the CI. However, I don't want to verify by publishing to NPM.It would differ from the
changeset versionbecause what I want is to verify if "NPM publish" worked, not "versioning the packages" worked.alburdette619 commentedon Jun 17, 2025
I'm currently in need of this option. I am running into an issue where the calls to
npm infofrom publish are getting an inconsistentE401. The token seems fine and different packages each time trigger the error with some having worked fine the previous attempt.I had thought this was
changset versionso I commented out my call topublishbut now there's nonpm infocalls at all. Without doing a full run of PR to make changes to my github workflows, auto run changsets to create a release PR, and then manually run my release workflow. I cannot test what I need to and have no clue why the initial issue is happening.danguilherme commentedon Aug 19, 2025
Just to be clear, adding to the comments, a dry run would also run validations, specially around authorisation -- does the npm auth token you're using work? This is very helpful when setting up CI.
In my case we're configuring it to publish internal packages into GitHub's package registry using a GitHub App's token. Similar to others in this thread, I'd like to test my workflow without actually publishing it first.
semantic-release's--dry-runworks really well for that.dipunm commentedon Jul 22, 2026
Hi, I would like to provide a use case. We use TeamCity at my workplace instead of Github actions, however we have a similar build and release flow as recommended in the docs.
We allow the creation of pre-release packages and publish them using
pnpm changeset publishThere is a race condition:
The issue is that we use the
pnpm changeset publishcommand and the outcome in this situation is this:Packages that are pre-release get published with a pre-release version:
[email protected]and tag
package1@PRXXXPackages that are missing from our remote repository are ALSO published, but with a pre-release tag (not latest which is our saving grace)
[email protected]package2@PRXXXThe issue is that this publish happened in our PR build which is not designed to then do further work like creating github releases.
The main build that would have published these will identify that they were already published and will skip publishing with the
latesttag and creating github releases etc because it assumes that that work must have already been done if the package already exists in our repository.Our current use case is to be able to detect if the PR build will over publish and fail fast or take alternative action.
In hindsight, one might consider this behaviour to simply be a bug.
changeset publishshould specify exactly what packages it wants to publish and not attempt to publish anything else as default behaviour.Andarist commentedon Jul 22, 2026
@dipunm does this command satisfy your needs #2061 ? It's coming in the soon-to-be-released Changesets v3
dipunm commentedon Jul 23, 2026
@Andarist I found a workaround which was to directly call
pnpm -r publish --dry-run --jsonand parse the output before running any changeset steps (ensuring it is clean before starting).That said, this blocks the pipeline (albeit a minor, easy to resolve block) which is not ideal.
What package managers do you officially support? I found that at least with
pnpm, you can use --filter and name the packages that you want to publish and it will not publish anything else. This would allow the build to run without race conditions or blocks. I can create a new issue for this if it helps?