ci: Improve release notes for pre-releases#709
Merged
YDX-2147483647 merged 1 commit intoBITNP:mainfrom Jan 7, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the release notes generation for pre-releases by fixing git-cliff configuration issues. Previously, pre-release versions had empty release notes due to incorrect usage of the --unreleased flag and configuration settings.
Key changes:
- Enhanced the cliff.toml template to handle public releases, pre-releases, and testing scenarios differently
- Updated the GitHub Actions workflow to use appropriate git-cliff flags based on release type
- Added job summary output for better visibility of generated release notes
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cliff.toml | Added conditional logic to generate different release note headers for public releases, pre-releases, and testing; duplicated ignore_tags pattern in template to prevent CLI override |
| .github/workflows/release.yml | Modified git-cliff arguments to use --current for releases and conditional tag filtering for public vs pre-releases; added step to output release notes to job summary |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
之前没设置好git-cliff(也可能是git-cliff有缺陷),预发布版的发行说明没有东西,例如 https://github.com/BITNP/BIThesis/releases/tag/v3.8.8-alpha.2 。
原因分析
(非常混乱,但 git-cliff 2.11.0 似乎确实如此……)
之前给git-cliff指定了
--unreleased。原以为git cliff --unreleased等于git cliff结果中的[unreleased]部分,实际上只是子集,具体情况要慢慢分析……git-cliff解析历史时,会把标签分为以下 2+1 = 3 类。分类方法受
ignore_tags和tag_pattern两项设置影响,且CLI设置(见.github/workflows/release.yml)会覆盖cliff.toml设置(ignore_tags = ".*alpha|beta|-.*";tag_pattern未设置,相当于.*)。tag_patterntag_pattern但不匹配ignore_tagstag_pattern且匹配ignore_tagstag_pattern在changelog模板中,有三个变量相关:
version:当前标签,可能为null--unreleased,则为null--current,则为HEAD对应的标签--latest,则为整个历史中的最新标签用 release.published 事件触发 GitHub Actions 时,release 对应的标签已经创建了,所以
--latest和--current效果相同。previous.version:上一正式标签commits:从上一有效标签到当前标签的提交记录对于当前标签为null的情况,上一有效标签就是HEAD。
以上理论可以解释目前所有现象。