From 9d95de535d0d6252710f9cb6fbdc532c9d285cea Mon Sep 17 00:00:00 2001 From: John Crenshaw Date: Wed, 2 Dec 2026 08:03:56 -0500 Subject: [PATCH] ci: take each draft's release notes from its CHANGELOG section The draft was created with empty notes and the signing script publishes it as is, so every release from v1.0.0 to v2.2.0 is blank on GitHub. The notes were in the CHANGELOG the whole time. A tag whose version has no section now gets no draft, the same rule Cadence's release follows. --- .github/workflows/release.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a07e2d..b9415a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -213,6 +213,12 @@ jobs: run: shell: bash steps: + # Checked out before the download, so the checkout's clean can't touch dist/. + # Only CHANGELOG.md is read, and nothing here pushes, so the token stays out. + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: pattern: terminus-* @@ -236,6 +242,22 @@ jobs: exit 1 fi + # The release notes are this version's CHANGELOG section, minus the link + # block at the foot. A tag with no section gets no draft. + - name: Slice the CHANGELOG section for this version + run: | + set -euo pipefail + ver="${GITHUB_REF_NAME#v}" + awk -v ver="$ver" ' + $0 ~ "^## \\[" ver "\\]" { f = 1; next } + f && /^## \[/ { exit } + f && !/^\[[^]]+\]: *http/ { print } + ' CHANGELOG.md > RELEASE_NOTES.md + if [ ! -s RELEASE_NOTES.md ]; then + echo "::error::CHANGELOG.md has no section for ${ver}" + exit 1 + fi + # A draft, never a prerelease: releases/latest skips prereleases, and # that is where install.sh looks once the owner publishes. - name: Create the draft @@ -247,4 +269,4 @@ jobs: --draft --verify-tag \ --repo "$GITHUB_REPOSITORY" \ --title "$GITHUB_REF_NAME" \ - --notes "" + --notes-file RELEASE_NOTES.md