Skip to content

Commit 9efacae

Browse files
HduSyclaude
andcommitted
ci: append auto-generated changelog to release notes
Adds a post-build step that fetches GitHub's generated notes (PRs/commits since the previous tag) and appends them to the release body, so each release lists what changed instead of only the static download blurb. Best-effort (continue-on-error) so notes never fail a release. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3c72b6e commit 9efacae

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ jobs:
7575
prerelease: false
7676
args: --target universal-apple-darwin
7777

78+
# Append an auto-generated changelog (PRs/commits since the previous tag)
79+
# to the release notes. Best-effort: never fail the release over notes.
80+
- name: Add changelog to release
81+
continue-on-error: true
82+
env:
83+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
run: |
85+
gen=$(gh api --method POST \
86+
"repos/${{ github.repository }}/releases/generate-notes" \
87+
-f tag_name="${{ github.ref_name }}" --jq '.body' || true)
88+
cur=$(gh release view "${{ github.ref_name }}" --json body --jq '.body' || true)
89+
{
90+
printf '%s\n' "$cur"
91+
if [ -n "$gen" ]; then printf '\n%s\n' "$gen"; fi
92+
} > release-body.md
93+
gh release edit "${{ github.ref_name }}" --notes-file release-body.md
94+
7895
- name: Update Homebrew Cask
7996
env:
8097
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

0 commit comments

Comments
 (0)