chore(release): unwrap CHANGELOG paragraphs for GitHub Release notes (#180)

GitHub renders release-note Markdown with GFM hard breaks, so every
`\n` becomes `<br>`. The CHANGELOG is hard-wrapped at ~75 chars for
readable diffs, which renders as awkward visible line breaks on the
release page (see https://github.com/colbymchenry/codegraph/releases/tag/v0.7.10).

Add `scripts/extract-release-notes.mjs` to extract a version block
and join indented continuation lines into a single line per bullet.
Nested list items, headings, and link references are preserved.
`scripts/release.sh` now uses this helper instead of the inline awk
extractor — repo-level CHANGELOG.md viewing is unaffected because
CommonMark there treats newlines as spaces.

Also fix the 0.7.10 entry: "Two underlying fixes" -> "Three", "Rust
file-/level" broken hyphen, and move the closes/credit line above
the nested list so it doesn't strand as a top-level paragraph.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-05-19 11:42:22 -05:00
committed by GitHub
co-authored by Claude Opus 4.7
parent fb8fb0ea8b
commit 483ec9171c
3 changed files with 128 additions and 15 deletions
+5 -7
View File
@@ -30,13 +30,11 @@ if ! grep -q "^## \[${VERSION}\]" CHANGELOG.md; then
exit 1
fi
NOTES=$(awk -v v="${VERSION}" '
/^## \[/ {
if (p) exit
if ($0 ~ "^## \\[" v "\\]") p = 1
}
p
' CHANGELOG.md)
# Extract notes with paragraph unwrapping — GitHub Releases render with
# GFM hard-breaks, so the CHANGELOG's hard-wrapped lines would show as
# visible `<br>` breaks otherwise. The helper joins continuation lines
# into a single line per bullet.
NOTES=$(node scripts/extract-release-notes.mjs "${VERSION}")
if [ -z "${NOTES}" ]; then
echo "error: failed to extract changelog notes for ${VERSION}" >&2