From c64e9a9014d97f86cbf823da74be2cc477b902c7 Mon Sep 17 00:00:00 2001 From: Philipp Wagner Date: Fri, 16 Oct 2026 11:22:57 +0200 Subject: [PATCH] Open the release notes with the message of an annotated tag (#130) The release body was built from direct commits on main and GitHub's generated PR list only; whatever was written into the tag was lost. An annotated tag's subject and body now open the notes, ahead of "What's Changed", and so reach the in-app update feed too. The tag object is fetched explicitly because actions/checkout can leave the triggering tag as a lightweight ref; contents:subject/body leave the SSH signature out. Lightweight tags contribute nothing, as before. Co-authored-by: Claude Opus 5.5 --- .github/workflows/tagged-release.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 30f12c23..d764bce4 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -867,7 +867,9 @@ jobs: fetch-depth: 0 # GitHub's generated release notes list merged pull requests only. Commits - # pushed directly to main are added here as their own section: + # pushed directly to main are added here as their own section, and the + # message of an annotated tag opens the body: + # (annotated tags only; signature dropped) # ## What's Changed # ### Commits on main (first-parent commits, no merges, no bots) # ### Merged PRs (GitHub's generated PR list) @@ -892,6 +894,19 @@ jobs: RANGE="$TAG" [ -n "$PREVIOUS_TAG" ] && RANGE="${PREVIOUS_TAG}..${TAG}" + # actions/checkout can leave the triggering tag as a lightweight ref, so + # fetch the tag object itself before reading its message. + git fetch --force origin "refs/tags/${TAG}:refs/tags/${TAG}" + # A lightweight tag has no message of its own (its "message" would be the + # commit's); only an annotated tag contributes. contents:subject and + # contents:body leave out an SSH or GPG signature. + : > tag-message.md + if [ "$(git cat-file -t "refs/tags/${TAG}")" = "tag" ]; then + git for-each-ref "refs/tags/${TAG}" \ + --format='%(contents:subject)%0a%0a%(contents:body)' > tag-message.md + fi + echo "Tag message:"; cat tag-message.md + # --first-parent keeps the commits made directly on main; commits inside # pull requests are covered by the PR list. Squash-merged PRs end in # "(#123)" and are listed by GitHub as well. @@ -913,6 +928,7 @@ jobs: import re commits = open("direct-commits.md", encoding="utf-8").read().strip() + tag_message = open("tag-message.md", encoding="utf-8").read().strip() generated = open("generated-notes.md", encoding="utf-8").read() # GitHub's body: "## What's Changed" with the PR list, optionally @@ -932,6 +948,8 @@ jobs: rest.append(line) parts = [] + if tag_message: + parts.append(tag_message) if commits or prs: parts.append("## What's Changed") if commits: