@@ -17,14 +17,22 @@ jobs:
1717 id : version
1818 run : echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
1919
20- - name : Validate CHANGELOG contains version
20+ - name : Extract CHANGELOG entry for release notes
2121 run : |
22- if ! grep -q "\[${{ steps.version.outputs.version }}\]" CHANGELOG.md; then
23- echo "Error: CHANGELOG.md does not contain entry for version ${{ steps.version.outputs.version }}"
24- echo "Please add a section like: ## [${{ steps.version.outputs.version }}] - $(date +%Y-%m-%d)"
22+ VERSION="${{ steps.version.outputs.version }}"
23+ # Print the body of the "## [VERSION] - ..." section, up to the next "## [" heading.
24+ awk -v ver="$VERSION" '
25+ $0 ~ "^## \\[" ver "\\]" { found = 1; next }
26+ found && /^## \[/ { exit }
27+ found { print }
28+ ' CHANGELOG.md | sed '/./,$!d' > release_notes.md
29+ if [ ! -s release_notes.md ]; then
30+ echo "Error: CHANGELOG.md does not contain an entry for version $VERSION"
31+ echo "Please add a section like: ## [$VERSION] - $(date +%Y-%m-%d)"
2532 exit 1
2633 fi
27- echo "CHANGELOG.md contains version ${{ steps.version.outputs.version }}"
34+ echo "Extracted release notes for $VERSION:"
35+ cat release_notes.md
2836
2937 - name : Create skill zip
3038 run : |
3745 uses : softprops/action-gh-release@v3
3846 with :
3947 name : v${{ steps.version.outputs.version }}
48+ body_path : release_notes.md
4049 generate_release_notes : true
4150 files : imaging-data-commons-${{ steps.version.outputs.version }}.zip
4251 env :
0 commit comments