Skip to content

pnpm-release-changeset.yml passes changesets/action v1 input names to @v2.0.0 — publishing silently never runs #43

Description

@unional

Description

.github/workflows/pnpm-release-changeset.yml pins changesets/action@v2.0.0 but still passes the v1 input names. changesets/action@v2.0.0 renamed every one of them:

Passed by the workflow (v1) Actual v2.0.0 input
version version-script
publish publish-script
commit commit-message
title pr-title

GitHub Actions does not fail on unknown with: keys — it ignores them. So the action runs with all three of these unset, and falls back to its defaults.

The consequential one is publish-script. When it is unset, the action only ever creates/updates a version PR and never publishes to npm. There is no error; the job goes green. A release would appear to succeed while nothing is published.

Secondary effects:

  • version-script unset falls back to the built-in changeset version, bypassing pnpm run version. Benign for consumers whose version script is just changeset version, but it is no longer the repo's own script.
  • commit-message unset falls back to Version Packages instead of the intended chore: version packages.

Additional concern: token and permissions

changesets/action@v2.0.0 pushes release commits and tags through the GitHub API by default (push-with-git-cli defaults to false), authenticated by the github-token input, which defaults to ${{ github.token }}.

The workflow supplies its custom token only as the GITHUB_TOKEN environment variable (secrets.CI_GITHUB_TOKEN), not as the github-token input. Under v2 that env var is not what the action authenticates with, so the custom token is effectively ignored.

That matters because the job declares permissions: contents: read, while pushing commits and tags requires contents: write. Worth verifying both together when fixing the input names.

Also: changesets/action@v2 requires Changesets CLI v3

v2.0.0's release notes state it updates to Changesets v3 packages, and it validates the consumer's CLI version, directing CLI v2 users to changesets/action@v1.

Any repo using this reusable workflow while still on @changesets/cli v2 is therefore already mismatched. repobuddy/repobuddy is upgrading to @changesets/cli v3 now, which resolves that half — but the renamed inputs above are independent of the CLI version and still need fixing here.

Expected Behavior

The reusable workflow invokes changesets/action@v2.0.0 with the input names that version actually accepts, so pnpm run release runs and packages publish.

Actual Behavior

publish-script is never set, so the publish step does not run. The workflow reports success without publishing.

Suggested Fix

- uses: changesets/action@v2.0.0
  with:
    github-token: ${{ secrets.CI_GITHUB_TOKEN }}
    commit-message: 'chore: version packages'
    version-script: pnpm run version
    publish-script: pnpm run release

plus raising the job's permissions to contents: write (keeping id-token: write).

Notes

Found while upgrading repobuddy/repobuddy to @changesets/cli v3. That repo consumes this reusable workflow but cannot change it, so recording the coupling here before the upgrade lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions