feat: include compare-with-previous link in release notes - #12
Merged
Conversation
Matches the format GitHub's auto-generated release notes use (and what
release-please wrote into CHANGELOG.md headers): a "**Full Changelog**:"
footer line at the bottom of each release body, linking to the
GitHub compare view between the previous release tag and this one.
Guarded by `{% if previous.version %}` so the first release (which has
no previous tag) doesn't render a broken compare link.
Verified locally by re-rendering v1.3.2 against the new template — the
footer reads "Full Changelog: .../compare/v1.3.1...v1.3.2".
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.
Summary
release-please's CHANGELOG.md headers had a "compare" link in each version line — clicking the version took you to the GitHub diff between that release and the previous one. GitHub's own auto-generated release notes use a similar idea via a
**Full Changelog**:footer.Add the equivalent to our git-cliff-generated release notes — three-line addition to the template that renders a footer line when there's a previous tag to compare against.
Diff
{% endfor %} {% endfor -%} +{% if previous.version %} +**Full Changelog**: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/compare/{{ previous.version }}...{{ version }} +{% endif -%} """The
{% if previous.version %}guard protects the very-first-release case (no previous tag → no compare link rendered).Local verification
Re-rendered v1.3.2 with the new template:
Test plan
feat:→ minor bump) body ends with**Full Changelog**: https://github.com/giantswarm/test-release-please/compare/v1.3.2...v1.4.0and the URL is clickable.