Skip to content

Commit 2fb275d

Browse files
committed
feat: enhance GitHub release notes with changelog content
1 parent 9e5a5df commit 2fb275d

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/release.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,37 @@ jobs:
3333
run: npm run release -- --commit-all # standard-version determines version based on commits
3434
# Add --first-release if this is the absolute first tag/release
3535

36+
- name: Get version from package.json
37+
id: package-version
38+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
39+
40+
- name: Extract changelog content
41+
id: changelog
42+
run: |
43+
VERSION=$(node -p "require('./package.json').version")
44+
CHANGELOG_CONTENT=$(awk "/### \[$VERSION\]/,/### \[.*\]/ { if (!/### \[.*\]/ || NR==1) print; }" CHANGELOG.md | sed '1d;$d')
45+
echo "content<<EOF" >> $GITHUB_OUTPUT
46+
echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT
47+
echo "EOF" >> $GITHUB_OUTPUT
48+
3649
- name: Push changes and tags
3750
run: git push --follow-tags origin main
3851
# Ensure this pushes to the correct branch (e.g., main)
3952

4053
- name: Create GitHub Release
4154
uses: softprops/action-gh-release@v1
4255
# This action runs implicitly on tag push, which is handled by the previous step.
43-
# If you want more control, you can extract the tag version and trigger explicitly.
4456
env:
4557
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4658
with:
47-
generate_release_notes: true # Use conventional commits for release notes
59+
tag_name: v${{ steps.package-version.outputs.version }}
60+
name: Release v${{ steps.package-version.outputs.version }}
61+
body: |
62+
## Release Notes
63+
64+
${{ steps.changelog.outputs.content }}
65+
66+
## Changes
67+
68+
See the [CHANGELOG.md](./CHANGELOG.md) for all changes and the complete history.
69+
generate_release_notes: true # Will append GitHub's generated notes

0 commit comments

Comments
 (0)