Skip to content

changeset version should return a non-zero error code if there are no changesets聽#1815

Description

@mcintyre94

In a repo with changesets configured but no changesets:

$ npx changeset version --snapshot canary
馃  warn No unreleased changesets found, exiting.
$ echo $?
0

This makes it difficult to publish canary builds using changesets. For example the following CI job:

$ pnpm changeset version --snapshot canary
$ pnpm publish --tag canary

The expected behaviour is that we version our packages with a -canary-<something> suffix, and then publish packages with version x.y.z.canary-<something> to NPM

But in the case that there are no changesets, this will print the warning about no changesets, and then silently continue to publish our packages as x.y.z with the tag canary. This then causes issues if another CI job is intended to publish x.y.z with the tag latest, as that version is already published on npm.

I think the best solution would be for changeset version to return a non-zero exit code when there are no changesets.

Activity

  1. MrSkippy commented on Feb 19, 2026

    @MrSkippy

    I got the same problem.

    Even better would be a --snapshot possibility baked in the changesets action that handles the version and publish.

  2. added a commit that references this issue on Feb 28, 2026
    ae3f67d
  3. Andarist commented on May 4, 2026

    @Andarist
    Member

    Even better would be a --snapshot possibility baked in the changesets action that handles the version and publish.

    @MrSkippy let's discuss that in the changesets/action repository.

  4. added a commit that references this issue on May 4, 2026
    92b1c1b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions