Skip to content

Publish only when the first CHANGELOG heading is this version - #75

Merged
bompus merged 1 commit into
mainfrom
publish-changelog-heading
Nov 6, 2026
Merged

bompus merged 1 commit into
mainfrom
publish-changelog-heading

Conversation

@bompus

@bompus bompus commented Nov 6, 2026

Copy link
Copy Markdown
Owner

CHANGELOG.md is in the package's files, so it ships in every tarball. The published 1.0.2 and 1.0.3 tarballs carry an empty ## Unreleased heading above their own entry (git show v1.0.2:CHANGELOG.md, git show v1.0.3:CHANGELOG.md). Nothing in publish.yml read the changelog.

This adds one step after "Tag commit is on main": the job stops before npm publish unless the first ## heading in CHANGELOG.md is ## <package.json version> - YYYY-MM-DD. publish.yml is the only file changed. No release, tag or publish.

Checked:

  • The step's script run against package.json and CHANGELOG.md from each tag: passes v1.0.0, v1.0.1 and v1.0.4; fails v1.0.2 and v1.0.3 (the two real misses), a version/heading mismatch, and a missing CHANGELOG.md.
  • On current main the step would fail, because main now has a ## Unreleased section on top. That is the intended effect: the release commit renames it to the version before tagging.
  • bun run check passes.
  • A separate read-only review found the shell correct under bash -e (quoting, case, || true, pre-release versions) and no effect on publishing, provenance or permissions. Its one low finding: a ## <version> line inside a fenced code block placed before the first real heading would pass. CHANGELOG.md has no such preamble and the check is a guard against the leftover-heading mistake, not a Markdown parser, so it is left as is.

CHANGELOG.md ships in the package, and the 1.0.2 and 1.0.3 tarballs
carry an empty "## Unreleased" heading above their own entry. The
publish workflow now stops before "npm publish" unless the first
"## " heading in CHANGELOG.md is "## <package.json version> - YYYY-MM-DD".
@bompus bompus added the author:anthropic Pull request written by a anthropic model label Nov 6, 2026

@bompus-ai-review bompus-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bompus AI Review (GPT-6.1 Terra, max reasoning; SWE-2 Max, max reasoning): 0 finding(s).

@bompus
bompus merged commit 60a342f into main Nov 6, 2026
7 checks passed
@bompus
bompus deleted the publish-changelog-heading branch November 6, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:anthropic Pull request written by a anthropic model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant