From 243fc6688ce5554d1bf3e968303c92b81dc4b832 Mon Sep 17 00:00:00 2001 From: screentinker Date: Thu, 13 Aug 2026 22:31:32 -0500 Subject: [PATCH] Release notes: publish the changelog entry, not the commit subjects (#273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cutting 1.9.34 produced a release page reading: ### Changes - chore(release): v1.9.34 - Changelog: one 1.9.34 entry, and credit where it was missing while the entry describing single sign-on, the removal of the last native image dependency, three update failures and every outside contributor sat in CHANGELOG.md and was never published. The notes on the release page are what most people actually read; they should be the written ones. The workflow now takes the section for the version being released and uses it as the body. Commit subjects remain the fallback for a version with no entry, so a release never publishes with no notes at all — scripts/bump-version.sh already warns about a missing heading, and this is the same gap showing up downstream. awk rather than sed for the extraction: the body contains regex metacharacters and markdown that a sed range would mangle. Verified against the real file: 1.9.34 extracts 269 lines and stops at the next heading with all 13 contributor credits intact, 1.9.33 and 1.9.29 extract cleanly, and a version with no entry yields nothing and takes the fallback. v1.9.34's notes were corrected by hand after release; this is so the next one does not need that. --- .github/workflows/release.yml | 37 ++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0522c5..efabb88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,15 +100,42 @@ jobs: - name: Generate release notes run: | PREV="${{ steps.ver.outputs.prev }}" + VERSION="${{ steps.ver.outputs.version }}" + + # Prefer the hand-written CHANGELOG section for this version. + # + # The generated list is commit SUBJECTS, which describe the work, not the release: cutting + # 1.9.34 produced a page reading "chore(release): v1.9.34" and one changelog commit, while + # the entry describing single sign-on, the native-dependency removal, the update fixes and + # every outside contributor sat in CHANGELOG.md and was never published. The notes on the + # release page are what most people actually read, so they should be the written ones. + # + # awk rather than sed: the body contains regex metacharacters and markdown that a sed range + # would mangle. This takes everything between `## ` and the next `## ` heading. + CHANGELOG_BODY="$(awk -v v="## $VERSION" ' + $0 == v {found=1; next} + found && /^## / {exit} + found {print} + ' CHANGELOG.md)" + { echo "## ScreenTinker ${{ steps.ver.outputs.tag }}" echo - echo "### Changes" - if [ -n "$PREV" ]; then - git log --no-merges --pretty='- %s' "${PREV}..${{ steps.ver.outputs.tag }}" + if [ -n "$(printf '%s' "$CHANGELOG_BODY" | tr -d '[:space:]')" ]; then + echo "$CHANGELOG_BODY" else - echo "_First tagged release. Most recent changes:_" - git log --no-merges --pretty='- %s' -n 30 "${{ steps.ver.outputs.tag }}" + # No entry for this version — fall back to commit subjects rather than publish a + # release with no notes at all. scripts/bump-version.sh already warns when the + # CHANGELOG has no matching heading; this is the same gap showing up downstream. + echo "_No CHANGELOG entry for $VERSION; listing commits instead._" + echo + echo "### Changes" + if [ -n "$PREV" ]; then + git log --no-merges --pretty='- %s' "${PREV}..${{ steps.ver.outputs.tag }}" + else + echo "_First tagged release. Most recent changes:_" + git log --no-merges --pretty='- %s' -n 30 "${{ steps.ver.outputs.tag }}" + fi fi echo echo "### Artifacts"