From 4bf0d1819d9760805346c875fe64c28acce87c9e Mon Sep 17 00:00:00 2001 From: Novattz Date: Mon, 22 Dec 2025 20:21:41 +0100 Subject: [PATCH] workflow change --- .github/workflows/build.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6347912..b88c8fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,11 +28,37 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Package version: $VERSION" + - name: get changelog notes for version + id: changelog + env: + VERSION: ${{ steps.get-version.outputs.version }} + run: | + NOTES="$(awk -v ver="$VERSION" ' + BEGIN { found=0 } + $0 ~ "^## \\[" ver "\\] - " { found=1 } + found { + if ($0 ~ "^## \\[" && $0 !~ "^## \\[" ver "\\] - " ) exit + print + } + ' CHANGELOG.md)" + + if [ -z "$NOTES" ]; then + echo "No changelog entry found for version $VERSION" >&2 + exit 1 + fi + + { + echo "notes<> "$GITHUB_OUTPUT" + - name: create draft release id: create-release uses: actions/github-script@v6 env: VERSION: ${{ steps.get-version.outputs.version }} + NOTES: ${{ steps.changelog.outputs.notes }} with: script: | const { data } = await github.rest.repos.createRelease({ @@ -40,7 +66,7 @@ jobs: repo: context.repo.repo, tag_name: `v${process.env.VERSION}`, name: `v${process.env.VERSION}`, - body: 'Release.', + body: process.env.NOTES, draft: true, prerelease: false })