Skip to content

Commit 6ea1768

Browse files
cursoragentYukaii
andcommitted
ci: seed GitHub Releases with the changelog entry
Use the matching CHANGELOG.md section as the release notes and still append GitHub's generated PR list so tagged publishes match v2.5.0-style history without requiring a manual GitHub UI draft. Co-authored-by: Yukai Huang <hi@yukai.dev>
1 parent 9b1019c commit 6ea1768

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,19 @@ jobs:
5050
GH_TOKEN: ${{ github.token }}
5151
run: |
5252
TAG="${GITHUB_REF_NAME}"
53+
VERSION="${TAG#v}"
5354
if gh release view "$TAG" >/dev/null 2>&1; then
5455
echo "GitHub release ${TAG} already exists, skipping"
5556
exit 0
5657
fi
58+
NOTES="$(awk -v ver="$VERSION" '
59+
$0 == "## " ver {p=1; next}
60+
p && /^## / {exit}
61+
p
62+
' CHANGELOG.md)"
5763
gh release create "$TAG" \
5864
--title "$TAG" \
65+
--notes "$NOTES" \
5966
--generate-notes \
6067
--latest
6168

0 commit comments

Comments
 (0)