Skip to content

ci: read release notes before publishing to npm - #280

Merged
staylor merged 1 commit into
mainfrom
publish-notes-before-npm
Nov 11, 2026
Merged

staylor merged 1 commit into
mainfrom
publish-notes-before-npm

Conversation

@staylor

@staylor staylor commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Problem

publish.yml read the version's notes from CHANGELOG.md only in its last step, after npm publish. A version bump without a changelog section, such as a hand edit of package.json instead of pnpm release, would be published to npm, which can't be undone, and then the job failed with CHANGELOG.md has no section for <version>.

Fix

The notes are read right after pnpm install, under the same publish || release condition, so a missing section fails the job before the type checks and the publish. gh release create uses that file.

Tests

I replayed the steps after install from both versions of the workflow in order, the way Actions runs them (bash -eo pipefail, later steps skipped after a failure), with npm and gh stubbed and package.json at 3.2.0, which has no changelog section:

Job stops at npm publish
main Create the GitHub release called
This PR Read the release notes not called

At 3.1.0 every step runs and the release gets the full notes. actionlint passes.

The Publish workflow read the version's CHANGELOG.md section only when
it created the GitHub release, after npm publish. A version bump
without a changelog section, such as a hand edit of package.json, was
published to npm, which can't be undone, and then the workflow failed.

The notes are now read right after install, before the checks and the
publish, and the release step reuses that file.
@staylor
staylor merged commit ad86f85 into main Nov 11, 2026
6 checks passed
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.

1 participant