ci: fix release notes generation in release workflow#427
Merged
Conversation
prepare job failed: git-cliff --latest crashed with 'trim_start_matches on null' because the checkout was shallow (no tags/history) so no release existed. - checkout prepare with fetch-depth: 0 + fetch-tags so git-cliff sees full history and tags (also fixes an otherwise-truncated CHANGELOG) - generate release notes with --unreleased --tag v$VERSION instead of --latest: --latest selected the previous real tag (stale notes); --unreleased --tag renders the version being released
8f2775e to
3c7284d
Compare
|
✔️ 3c7284d - Conventional commits check succeeded. |
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.
Fixes the dry-run failure in run 27096060211 (prepare job, 11s).
Root cause
git-cliff --latest --strip headercrashed:Two compounding causes:
actions/checkoutdefaults tofetch-depth: 1, so git-cliff saw 1 commit and no tags → no release exists →versionis null → template crash. Also would have produced a near-empty CHANGELOG.--latestis the wrong selector — it picks the last real git tag (v1.0.0 → stale notes), not the version being released.Fix
fetch-depth: 0+fetch-tags: true.git-cliff --unreleased --tag v$VERSION --strip header— renders exactly the commits in the version being released.Verified locally:
--unreleased --tag v1.0.1emits## 1.0.1with the correct commits. zizmor clean, YAML valid.