Skip to content

fix(release): correct release notes + auto-update [Unreleased] changelog on merge#52

Merged
hi-lei merged 2 commits into
mainfrom
fix/release-notes-unreleased
Jun 2, 2026
Merged

fix(release): correct release notes + auto-update [Unreleased] changelog on merge#52
hi-lei merged 2 commits into
mainfrom
fix/release-notes-unreleased

Conversation

@hi-lei
Copy link
Copy Markdown
Collaborator

@hi-lei hi-lei commented Jun 2, 2026

What this does

Two related fixes to the changelog/release pipeline:

1. Release notes showed the previous version (bug fix)

Release notes were generated with git-cliff --tag <V> --latest before the tag is created, so --latest selected the most recent existing tag — the previous release. v1.7.1's notes displayed [v1.7.0]'s entries.

Fix: use --unreleased --tag <V>, which selects the not-yet-tagged commits and labels them with the new version (git-cliff's canonical pre-tag pattern).

2. [Unreleased] section now stays current (new workflow)

Previously CHANGELOG.md was only regenerated at release time, so [Unreleased] never reflected merged work. (It was even stale — missing the [v1.7.1] section.)

New Update Changelog workflow (.github/workflows/changelog.yml):

  • runs on push to main
  • regenerates CHANGELOG.md via make changelog.unreleased (git-cliff with no tag)
  • commits the refreshed [Unreleased] section back to main

A release then promotes [Unreleased][vX.Y.Z] via the existing --tag path.

Loop / no-op guards

  • auto-commit message is chore(changelog): ... [skip ci] → its own push doesn't re-trigger the workflow
  • release commit gains [skip ci] → a release push doesn't fire a redundant changelog run
  • cliff.toml skips chore(changelog) and chore(release) → neither bookkeeping commit appears as a changelog entry
  • concurrency group serializes rapid merges to avoid push races
  • step no-ops when CHANGELOG.md is unchanged

Flow

PR merged to main ──▶ Update Changelog ──▶ CHANGELOG.md [Unreleased] refreshed
release.yml (vX.Y.Z) ──▶ [Unreleased] promoted to [vX.Y.Z] + tag + GitHub release notes

Verification

Reproduced against git-cliff 2.7.0:

  • release notes: --latest[v1.7.1] (wrong) vs --unreleased[v9.9.9] (correct)
  • make changelog.unreleased → correct [Unreleased] section, chore(...) commits filtered out

The already-published v1.7.1 GitHub release notes will be fixed manually; these changes apply going forward. The stale committed CHANGELOG.md will auto-repair on the first merge after this lands.

🤖 Generated with Claude Code

hi-lei and others added 2 commits June 2, 2026 23:46
…vious tag

Release notes were built with `git-cliff --tag <V> --latest`, but that step
runs before the tag is created. With no <V> tag yet, `--latest` selects the
most recent existing tag, so each release shipped the previous version's
changelog (v1.7.1 showed v1.7.0's entries).

Use `--unreleased --tag <V>` instead: it selects the not-yet-tagged commits
and labels the section with the new version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds an Update Changelog workflow that runs on push to main, regenerates
CHANGELOG.md via `make changelog.unreleased` (git-cliff with no tag), and
commits the refreshed [Unreleased] section back. A release then promotes
[Unreleased] -> [vX.Y.Z] through the existing --tag path.

Loop/no-op guards:
- auto-commit uses `chore(changelog): ... [skip ci]` so its own push does
  not re-trigger the workflow
- release commit gains `[skip ci]` so a release push doesn't fire a
  redundant changelog run
- cliff.toml skips `chore(changelog)` and `chore(release)` so neither
  bookkeeping commit appears as a changelog entry
- concurrency group serializes rapid merges to avoid push races

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hi-lei hi-lei changed the title fix(release): generate release notes from unreleased commits, not previous tag fix(release): correct release notes + auto-update [Unreleased] changelog on merge Jun 2, 2026
@hi-lei hi-lei merged commit 3970e2d into main Jun 2, 2026
@hi-lei hi-lei deleted the fix/release-notes-unreleased branch June 2, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant