Skip to content

Commit 5f03bf1

Browse files
alexrinassclaude
andcommitted
ci: Extract release notes from CHANGELOG for GitHub releases
Parse CHANGELOG.md to extract version-specific notes instead of using auto-generated commit summaries. Provides curated, user-facing release notes following Keep a Changelog format. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent c35c6d8 commit 5f03bf1

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ jobs:
3636
- name: Build binaries
3737
run: ./scripts/build.sh ${GITHUB_REF#refs/tags/}
3838

39+
- name: Extract release notes from CHANGELOG
40+
id: changelog
41+
run: |
42+
VERSION=${GITHUB_REF#refs/tags/v}
43+
echo "Extracting release notes for version $VERSION"
44+
45+
# Extract content between this version and the next version header
46+
NOTES=$(awk -v ver="$VERSION" '
47+
/^## \[/ {
48+
if (found) exit
49+
if ($0 ~ "\\[" ver "\\]") found=1
50+
next
51+
}
52+
found { print }
53+
' CHANGELOG.md)
54+
55+
# Handle multi-line output for GitHub Actions
56+
echo "notes<<EOF" >> $GITHUB_OUTPUT
57+
echo "$NOTES" >> $GITHUB_OUTPUT
58+
echo "EOF" >> $GITHUB_OUTPUT
59+
3960
- name: Create Release
4061
id: create_release
4162
uses: softprops/action-gh-release@v1
@@ -46,13 +67,15 @@ jobs:
4667
dist/*-checksums.txt
4768
draft: false
4869
prerelease: ${{ steps.check_preview.outputs.is_preview }}
49-
generate_release_notes: true
70+
generate_release_notes: false
5071
body: |
5172
${{ steps.check_preview.outputs.is_preview && '⚠️ This is a preview release and may not be stable.' || '' }}
52-
73+
74+
${{ steps.changelog.outputs.notes }}
75+
5376
## Installation
5477
See the [installation instructions](https://github.com/gittower/git-flow-next#installation) in the README.
55-
78+
5679
## Checksums
5780
SHA-256 checksums for the release artifacts are available in the checksums.txt file.
5881
env:

0 commit comments

Comments
 (0)