Skip to content

Commit 3f20f0f

Browse files
DaveBuggclaude
andcommitted
ci: populate GitHub Release body from CHANGELOG section
The release job published only the auto compare-link as the release body. Extract the `## v<tag>` section from CHANGELOG.md into RELEASE_NOTES.md and pass it as body_path, so the Releases page shows the real notes (with the generated compare-link appended below). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent bc1328b commit 3f20f0f

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,31 @@ jobs:
264264
echo "Tag ${{ github.ref_name }} → publishing as stable release (Latest)."
265265
fi
266266
267+
# Pull the human-written section for this exact tag out of
268+
# CHANGELOG.md (from `## v<tag>` to the next `## v…` header) so the
269+
# Releases page shows real notes, not just the auto compare-link.
270+
# Empty file if the tag isn't in CHANGELOG — `generate_release_notes`
271+
# still supplies the compare link, so nothing breaks.
272+
- name: Extract changelog section for this tag
273+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
274+
run: |
275+
awk -v tag="${{ github.ref_name }}" '
276+
$0 ~ ("^## " tag "([ \t]|$)") {f=1; print; next}
277+
f && /^## v/ {f=0}
278+
f {print}
279+
' CHANGELOG.md > RELEASE_NOTES.md
280+
echo "---- release notes for ${{ github.ref_name }} ----"
281+
cat RELEASE_NOTES.md
282+
267283
- name: Create / update GitHub Release with assets
268284
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
269285
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
270286
with:
271287
tag_name: ${{ github.ref_name }}
272288
name: ${{ github.ref_name }}
289+
# CHANGELOG section first; generate_release_notes appends the
290+
# auto compare-link / PR list below it.
291+
body_path: RELEASE_NOTES.md
273292
generate_release_notes: true
274293
fail_on_unmatched_files: true
275294
files: release/*

0 commit comments

Comments
 (0)