Skip to content

Commit 2ae7a1b

Browse files
fix: release notes (#362)
1 parent 02d5fea commit 2ae7a1b

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/merge-release-pr.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,30 @@ jobs:
4141
echo "VERSION=$VERSION" >> $GITHUB_ENV # Save version as environment variable
4242
shell: bash
4343

44+
- name: Extract changelog for version
45+
id: extract_changelog
46+
run: |
47+
VERSION_NUMBER=${VERSION#v} # Remove 'v' prefix for matching
48+
# Extract changelog section between this version and next version header
49+
CHANGELOG=$(awk "/^## \[${VERSION_NUMBER}\]/{flag=1; next} /^## \[|^### Changelog/{if(flag) exit} flag" CHANGELOG.md)
50+
# Handle multiline content for GitHub Actions
51+
echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV
52+
echo "$CHANGELOG" >> $GITHUB_ENV
53+
echo "EOF" >> $GITHUB_ENV
54+
shell: bash
55+
4456
- name: Publish to npm
4557
env:
4658
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4759
run: npm publish --tag latest
4860

4961
- name: Create GitHub Release
50-
uses: actions/create-release@v1
62+
uses: softprops/action-gh-release@v2
5163
env:
5264
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5365
with:
54-
tag_name: ${{ env.VERSION }} # Use the extracted version
55-
release_name: ${{ env.VERSION }} # Use the extracted version
66+
tag_name: ${{ env.VERSION }}
67+
name: ${{ env.VERSION }}
68+
body: ${{ env.RELEASE_BODY }}
5669
draft: false
5770
prerelease: false

0 commit comments

Comments
 (0)