Repository navigation
Publish only when the first CHANGELOG heading is this version - #75
Merged
Merged
Conversation
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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGELOG.mdis in the package'sfiles, so it ships in every tarball. The published 1.0.2 and 1.0.3 tarballs carry an empty## Unreleasedheading above their own entry (git show v1.0.2:CHANGELOG.md,git show v1.0.3:CHANGELOG.md). Nothing inpublish.ymlread the changelog.This adds one step after "Tag commit is on main": the job stops before
npm publishunless the first##heading inCHANGELOG.mdis## <package.json version> - YYYY-MM-DD.publish.ymlis the only file changed. No release, tag or publish.Checked:
package.jsonandCHANGELOG.mdfrom 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 missingCHANGELOG.md.mainthe step would fail, becausemainnow has a## Unreleasedsection on top. That is the intended effect: the release commit renames it to the version before tagging.bun run checkpasses.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.mdhas no such preamble and the check is a guard against the leftover-heading mistake, not a Markdown parser, so it is left as is.