fix(ci): generate release notes for the tagged range - #88
Merged
Conversation
The v0.4.0 release came out with an empty version header and no commits. `conventional-changelog -r 1` on its own emits the unreleased section, which is empty when HEAD is the tag being released, and the header it does emit carries no version because the root package.json has none, so the `sed` that was meant to strip it never matched and the fallback to GitHub's generated notes never ran. Pass the range explicitly (previous tag .. this tag) and add `--stdout`, which v8 needs to print instead of writing CHANGELOG.md. Presets are no longer bundled with the CLI, so `conventional-changelog` and `conventional-changelog-conventionalcommits` move into devDependencies and the job installs them. That also lets the changelog read its config from .github/changelog.config.mjs, which unhides docs, chore, refactor, test, build, style and ci so the notes list every commit.
Contributor
|
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.
The v0.4.0 release came out with an empty version header and no commits:
conventional-changelog -r 1on its own emits the unreleased section, which isempty when HEAD is the tag being released. The header it does emit carries no
version, because the root
package.jsonhas none, so thesedthat was meantto strip it never matched and the fallback to GitHub's generated notes never
ran.
Changes
..this tag) via--from/--to,with
git describefinding the previous tag. Without a previous tag thefirst release still works, since
--fromis omitted.--stdout. v8 writes toCHANGELOG.mdby default.conventional-changelogandconventional-changelog-conventionalcommitsinto devDependencies and install them in the job. v8 no longer bundles
presets, so
-p conventionalcommitsfails on a clean checkout..github/changelog.config.mjs, which clears thehiddeneffect on thepreset's commit types so
docs,chore,refactor,test,build,styleandcishow up under their own sections.##heading rather than matching a version pattern. Sectionheadings are
###, so nothing else is caught.Verification
Ran the step extracted from the workflow YAML against real tags, with
ghstubbed:
--from, worksThe v0.4.0 release body has already been regenerated with
gh release edit.