fix: release.yml 增量 Release Notes,不再包含全部历史 PR#84
Merged
Conversation
bigmanBass666
marked this pull request as ready for review
July 18, 2026 16:21
bigmanBass666
enabled auto-merge (squash)
July 18, 2026 16:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
v0.1.1 Release Notes 包含了从项目开始到现在的所有 PR(#6 ~ #75),而它应该只包含 v0.1.0 之后新增的 PR(#67 ~ #75)。
根因
softprops/action-gh-release@v2的generate_release_notes: true选项不指定previous_tag时,GitHub API 生成的 Release Notes 使用默认起始点,不是从上一个 tag 做增量。修复
在 Release 步骤前增加两步:
gh api获取上一个 release 的 taggenerate-notesAPI 并显式传入previous_tag,生成增量 changelogsoftprops/action-gh-release的body参数效果
下一次 Release(v0.1.2)的 Release Notes 将只显示 v0.1.1 之后的变更,不再重复列出全部历史 PR。