Skip to main content
Version: Next

Using Changesets with pnpm


At the time of writing this documentation, the latest pnpm version was v6.3.0. The latest Changesets version was v2.16.0.


To setup changesets on a pnpm workspace, install changesets as a dev dependency in the root of the workspace:

pnpm add -DW @changesets/cli

Then changesets' init command:

pnpx changeset init

Adding new changesets#

To generate a new changeset, run pnpx changeset in the root of the repository. The generated markdown files in the .changeset directory should be committed to the repository.

Releasing changes#

  1. Run pnpx changeset version. This will bump the versions of the packages previously specified with pnpx changeset (and any dependents of those) and update the changelog files.
  2. Run pnpm install. This will update the lockfile and rebuild packages.
  3. Commit the changes.
  4. Run pnpm publish -r. This command will publish all packages that have bumped versions not yet present in the registry.

Using GitHub Actions#

To automate the process, you can use changeset version with GitHub actions.

Bumb up packages#

The action will detect when changeset files arrive in the main branch, the action will open a new PR listing all the packages with bumped versions. Once merged, the packages will be updated and you can decide whether to publish or not by adding the publish property.


By adding publish: pnpm ci:publish which is a script that executes changeset publish will publish to the registry once the PR is opened by changeset version.

name: Changesets
- main
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
timeout-minutes: 15
runs-on: ubuntu-latest
- name: checkout code repository
uses: actions/[email protected]
fetch-depth: 0
- name: setup node.js
uses: actions/setup-[email protected]
node-version: 14
- name: install pnpm
run: npm i [email protected] -g
- name: Setup npmrc
run: echo "//${{ secrets.NPM_TOKEN }}" > .npmrc
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install
- name: create and publish versions
uses: changesets/[email protected]
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish

More info and documentation regarding this action can be found here.

Last updated on by Juan Picado