Skip to content

fix(release): bump changesets/action to v2, and pin the checkout - #6

Merged
btravers merged 1 commit into
mainfrom
fix/changesets-action-v2
Aug 25, 2026
Merged

fix(release): bump changesets/action to v2, and pin the checkout#6
btravers merged 1 commit into
mainfrom
fix/changesets-action-v2

Conversation

@btravers

Copy link
Copy Markdown
Contributor

Closes #5. Two fixes in one file family, one of them urgent.

The urgent one: v1 breaks any repo with .changeset/CLAUDE.md

changesets/action@v1 bundles @changesets/read@^0.6.7, which parses every .changeset/*.md as a changeset. A repository that keeps agent guidance beside its changesets fails the whole release:

##[error]Error: could not parse changeset - missing or invalid frontmatter.

Not hypothetical — that is btravstack/btravstack's release pipeline right now, red on every merge to main since it added a .changeset/CLAUDE.md.

@changesets/read@1.0.0, which v2 bundles, ignores README.md, AGENTS.md, CLAUDE.md and GEMINI.md. The ecosystem added that list for exactly this reason:

const ignoredMdFiles = [/^README\.md$/i, "AGENTS.md", "CLAUDE.md", "GEMINI.md"];

Worth noting why it was invisible until now: a consumer's own pnpm run version is unaffected, because the repository installs a current @changesets/read. Only the action's bundled copy is old, so the failure appears solely in CI.

It is not a version bump alone

v2 renamed every input:

v1 v2
version version-script
publish publish-script
commit commit-message
title pr-title

And github-token is an input now, not just the env var — this one would have failed silently. v2 defaults it to ${{ github.token }}, so passing the PAT through the environment alone falls back to the bot token, and a release PR opened by that starts no workflow runs. That is the single thing the PAT exists to prevent, so it is passed as an input here and kept in env as well.

Closes #5 in the same file

An optional ref input, defaulting to "" so omitting it keeps today's behaviour exactly. A caller on workflow_run passes the commit the green run measured:

uses: btravstack/tools/.github/workflows/release-reusable.yml@workflows-v1
with:
  ref: ${{ github.event.workflow_run.head_sha }}

Without it the checkout takes the default branch's current tip, which a push landing after CI went green can have moved — so a permanent npm tarball gets cut from a commit no CI run validated. btravstack/btravstack's own deploy-docs.yml already guards the identical hazard for a redeployable site; the release path wants it more.

This repository's own release.yml had both defects too and gets both fixes directly, since it inlines the action rather than calling the reusable workflow.

Also

Both workflows move off pnpm/action-setup@v4 and actions/setup-node@v4, which are forced onto Node 24 with a deprecation warning on every run. v6 and v7 are what .github/actions/setup here already uses.

After this lands

The workflows-v1 tag needs moving for consumers to pick it up. Then btravstack/btravstack can add ref: to its caller and drop the KNOWN GAP paragraph its release.yml header currently carries pointing at this issue — unthrown, entity, amqp-contract and temporal-contract get the CLAUDE.md fix for free without changing anything.

Closes #5.

**v1 breaks any repository that keeps agent guidance in `.changeset/`.** It
bundles `@changesets/read@^0.6.7`, which parses EVERY `.changeset/*.md` as a
changeset, so a `.changeset/CLAUDE.md` fails the whole release with

  could not parse changeset - missing or invalid frontmatter

That is not hypothetical: it is btravstack/btravstack's release pipeline right
now, red on every merge to main since it added one. `@changesets/read@1.0.0` —
what v2 bundles — ignores `README.md`, `AGENTS.md`, `CLAUDE.md` and
`GEMINI.md`, which is the ecosystem acknowledging exactly this. The consumer's
own `pnpm run version` was never affected, since a repository installs a
current `@changesets/read`; only the action's bundled copy is old.

v2 renamed every input, so this is not a version bump alone:
`version`→`version-script`, `publish`→`publish-script`, `commit`→
`commit-message`, `title`→`pr-title`.

**`github-token` is an input now, not just the env var**, and getting this
wrong would be silent: v2 defaults it to `${{ github.token }}`, so passing the
PAT through the environment alone falls back to the bot token — and a release
PR opened by that starts no workflow runs, which is the one thing the PAT
exists to prevent.

Closes #5 in the same file: an optional `ref` input, defaulting to "" so
omitting it keeps today's behaviour. A caller on `workflow_run` passes
`github.event.workflow_run.head_sha`, the exact commit the green run measured —
otherwise the checkout takes the default branch's CURRENT tip, which a push
landing after CI went green can have moved, and a permanent tarball is cut from
a commit no CI run validated. This repository's own `release.yml` pins it
directly.

Also moves both workflows off `pnpm/action-setup@v4` and
`actions/setup-node@v4`, which are forced onto Node 24 with a deprecation
warning on every run; v6 and v7 are what the composite action here already
uses.
@btravers
btravers merged commit 01ed3e0 into main Aug 25, 2026
4 checks passed
btravers added a commit to btravstack/amqp-contract that referenced this pull request Aug 25, 2026
btravstack/tools#6 added a `ref` input to the shared release workflow, and
`workflows-v1` now points at it. Passing
`github.event.workflow_run.head_sha` checks out the exact commit the green run
measured; without it a `workflow_run` checkout takes the default branch's
CURRENT tip, which a push landing after CI went green can have moved — cutting
a permanent npm tarball from a commit no CI run validated.

The window is small and the newer commit gets its own CI run, but a tarball
cannot be unpublished after 72 hours. btravstack/btravstack's `deploy-docs.yml`
has guarded the identical hazard all along for a redeployable site.

Nothing else changes here: the same tag move already brought
`changesets/action@v2` to this repository, which is what stops a
`.changeset/CLAUDE.md` from failing every release.
btravers added a commit to btravstack/temporal-contract that referenced this pull request Aug 25, 2026
btravstack/tools#6 added a `ref` input to the shared release workflow, and
`workflows-v1` now points at it. Passing
`github.event.workflow_run.head_sha` checks out the exact commit the green run
measured; without it a `workflow_run` checkout takes the default branch's
CURRENT tip, which a push landing after CI went green can have moved — cutting
a permanent npm tarball from a commit no CI run validated.

The window is small and the newer commit gets its own CI run, but a tarball
cannot be unpublished after 72 hours. btravstack/btravstack's `deploy-docs.yml`
has guarded the identical hazard all along for a redeployable site.

Nothing else changes here: the same tag move already brought
`changesets/action@v2` to this repository, which is what stops a
`.changeset/CLAUDE.md` from failing every release.
btravers added a commit to btravstack/unthrown that referenced this pull request Aug 25, 2026
btravstack/tools#6 added a `ref` input to the shared release workflow, and
`workflows-v1` now points at it. Passing
`github.event.workflow_run.head_sha` checks out the exact commit the green run
measured; without it a `workflow_run` checkout takes the default branch's
CURRENT tip, which a push landing after CI went green can have moved — cutting
a permanent npm tarball from a commit no CI run validated.

The window is small and the newer commit gets its own CI run, but a tarball
cannot be unpublished after 72 hours. btravstack/btravstack's `deploy-docs.yml`
has guarded the identical hazard all along for a redeployable site.

Nothing else changes here: the same tag move already brought
`changesets/action@v2` to this repository, which is what stops a
`.changeset/CLAUDE.md` from failing every release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release-reusable: checkout is not pinned to the triggering run's head_sha

1 participant