Skip to content

Commit b8788e0

Browse files
committed
Use CHANGELOG for release notes
1 parent 74ce51f commit b8788e0

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

.github/workflows/test-release.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ jobs:
4343
echo "should_release=true" >> $GITHUB_OUTPUT
4444
fi
4545
46+
- name: Extract changelog for version
47+
if: steps.tagcheck.outputs.should_release == 'true'
48+
id: changelog
49+
run: |
50+
VERSION="${{ steps.getversion.outputs.version }}"
51+
# Extract content between ## [VERSION] and the next ## [
52+
CHANGELOG=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d' | tail -n +2)
53+
if [ -z "$CHANGELOG" ]; then
54+
echo "No changelog entry found for version $VERSION"
55+
CHANGELOG="No changelog entry found. Please update CHANGELOG.md."
56+
fi
57+
# Use EOF delimiter for multi-line output
58+
echo "notes<<EOF" >> $GITHUB_OUTPUT
59+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
60+
echo "EOF" >> $GITHUB_OUTPUT
61+
4662
- name: Create GitHub Release
4763
if: steps.tagcheck.outputs.should_release == 'true'
4864
uses: softprops/action-gh-release@v2
@@ -51,6 +67,6 @@ jobs:
5167
name: Release v${{ steps.getversion.outputs.version }} (Test)
5268
draft: false
5369
prerelease: true
54-
generate_release_notes: true
70+
body: ${{ steps.changelog.outputs.notes }}
5571
env:
5672
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ All notable changes to this project will be documented in this file. This projec
1414

1515
Nothing yet.
1616

17+
## [1.23.1] - 2026-04-12
18+
19+
### Added
20+
21+
- Automated release workflow for creating GitHub releases from version tags.
22+
1723
## [1.23.0] - 2026-03-19
1824

1925
### Added
@@ -458,7 +464,8 @@ Nothing yet.
458464

459465
- Initial release
460466

461-
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.23.0...HEAD
467+
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.23.1...HEAD
468+
[1.23.1]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.23.0...v1.23.1
462469
[1.23.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.22.0...v1.23.0
463470
[1.22.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.21.0...v1.22.0
464471
[1.21.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.20.0...v1.21.0

0 commit comments

Comments
 (0)