Repository navigation
chore: deduplicate the release changelog automatically - #210
Merged
Merged
Conversation
release-please lists the same change twice whenever a pull request was merged with a GitHub merge commit. The merge commit carries the pull request title in its body: Merge pull request #171 from strapi-community/feat/cache-dashboard feat: add a cache statistics endpoint for the admin dashboard and release-please parses every conventional commit it finds in a message, so that body line becomes an entry attributed to the merge commit while the commit on the branch underneath produces an identical one. There is no setting for it. BEGIN_COMMIT_OVERRIDE is keyed on the pull request, and both commits are associated with the same one, so an override would suppress the real entry too; `changelog-type: github` deduplicates by listing pull requests instead of commits, but discards the conventional-commit sections. So this runs on every release rather than being hand-fixed once. release-please force-updates both the release branch and the draft notes on each run, so a manual edit would be overwritten the next time anything lands on main. Both surfaces are covered because they are generated separately: CHANGELOG.md on the release branch, and the draft release's own notes, which is what a maintainer actually reads before pressing Publish. Entries are matched on their text with the trailing ([sha](url)) stripped, since the two copies differ only by sha, and the first occurrence wins so the ordering is unchanged. A heading resets the comparison, so an entry that legitimately appears under two sections is kept. Verified against the real notes from the closed #200: 54 entries to 35, 19 duplicates removed, and a second run is a no-op. Co-Authored-By: Claude <noreply@anthropic.com>
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.
This was on #208 but did not make the squash — it was pushed after the merge.
It is needed before #209 is merged, or 5.1.0-beta ships with a changelog
listing 11 changes twice.
The problem
release-please lists the same change twice whenever a pull request was merged
with a GitHub merge commit. The merge commit carries the pull request title in
its body:
release-please parses every conventional commit it finds in a message, so
that body line becomes an entry attributed to the merge commit — while the
commit on the branch underneath produces an identical one.
Why it has to be automated
There is no setting for it:
BEGIN_COMMIT_OVERRIDEis keyed on the pull request, and both commits areassociated with the same one, so an override would suppress the real entry too.
changelog-type: githubdeduplicates by listing pull requests instead ofcommits, but discards the conventional-commit sections entirely.
And it cannot be fixed by hand once: release-please force-updates both the
release branch and the draft notes on every run, so a manual edit is overwritten
the next time anything lands on
main.What it does
Runs after release-please, on every release, over both surfaces — they are
generated separately, so fixing one does not fix the other:
CHANGELOG.mdon the rolling release branch (commits and pushes only if changed)Matching strips the trailing
([sha](url)), since the copies differ only bysha. First occurrence wins, so ordering is unchanged. A heading resets the
comparison, so an entry that legitimately appears under two sections survives.
Verified
Against the changelog currently in #209:
and against the old three-package notes from the closed #200: 54 → 35, 19
removed. A second run on either reports
no duplicates found, so it isidempotent and a no-op on future releases now that pull requests are squashed.
Caveat
Only the script is tested. The branch-checkout and
gh release editwiring getsits first real run when this merges. It runs after release-please, so if it
fails the worst case is the duplicates remaining — it cannot corrupt a release.
Touches a workflow, so it needs a maintainer to merge.
🤖 Generated with Claude Code