From 2ca1786c357fdebb56affa229c8c59e8d3d44c4e Mon Sep 17 00:00:00 2001 From: Tinic Uro Date: Mon, 28 Sep 2026 10:37:24 -0700 Subject: [PATCH] release-notes: take the paragraph from the tag object, never a commit beta7's published notes carried the #113 squash commit's body instead of the annotated tag's paragraph. actions/checkout leaves the pushed tag as a ref to the commit; on such a ref, %(contents:body) is the commit message, which the script took for the tag body. release-notes.sh reads the body only when refs/tags/$tag is a tag object (a lightweight tag gets no paragraph, as documented), and release.yml fetches the annotated tag object before rendering. Checked on the v1.0.0-beta7 tree: the annotated tag gives its four bullets; the tag rewritten as a commit ref gives no paragraph instead of the commit body. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 3 +++ tools/release-notes.sh | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 217858f5..31f9a5dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,6 +116,9 @@ jobs: # CHANGELOG.md without the version's section. notes=$(mktemp) trap 'rm -f "$notes"' EXIT + # checkout leaves the pushed tag pointing at the commit; fetch the + # annotated tag object so its paragraph reaches the notes + git fetch --force origin "+refs/tags/$tag:refs/tags/$tag" tools/release-notes.sh "$tag" > "$notes" gh release create "$tag" \ diff --git a/tools/release-notes.sh b/tools/release-notes.sh index 93fdf4b7..fe4e4ee6 100755 --- a/tools/release-notes.sh +++ b/tools/release-notes.sh @@ -38,9 +38,15 @@ section=$(awk -v v="## $ver" -v pfx="## ${ver%.*}." ' entries=$(printf '%s\n' "$section" | grep -c '^- ' || true) # The annotated tag's body, the paragraph written when the release was cut. -# A lightweight tag has none, and the notes do without. -summary=$(git tag -l --format='%(contents:body)' "$tag" 2>/dev/null | - sed '/^-----BEGIN PGP/,$d' | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}') +# A lightweight tag has none, and the notes do without. Read it only from a +# tag object: on a ref to a commit, %(contents:body) is the commit's message, +# and actions/checkout leaves the pushed tag as exactly such a ref, so beta7's +# first notes carried the squash commit's body. +summary="" +if [ "$(git for-each-ref --format='%(objecttype)' "refs/tags/$tag")" = tag ]; then + summary=$(git tag -l --format='%(contents:body)' "$tag" 2>/dev/null | + sed '/^-----BEGIN PGP/,$d' | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}') +fi # nameurlwhy; a malformed line fails the render rather than # publishing a broken bullet.