feat(pr): add changelogsLocation to post changelogs as a PR comment - #45379
feat(pr): add changelogsLocation to post changelogs as a PR comment#45379jasonwbarnett wants to merge 3 commits into
Conversation
Platforms that seed the squash commit message from the PR body put the whole changelog into the repository history. Setting changelogsLocation=comment posts the changelogs as a PR comment instead, leaving a short notice in the body.
|
I'd like to see this running against a real repository, please - helps confirm what this looks like It'd also be good to check what happens when a PR is updated (and new changelogs are added into it) - will this now update that comment? This might also be something we need to track in the repo cache, if it's not handled automagically |
|
Jason Barnett seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
5d51f7e to
23606ae
Compare
|
Done, running against a real repository with public Actions logs: https://github.com/altana-ai/renovate-changelogs-comment-demo The workflow checks out this feature branch, installs it, and runs
On the repo cache point: it is handled by the existing The demo did catch a bug, now fixed on the branch: the comment rendered |
|
Also checked the default path for regressions, in a separate control repository so the two runs stay clean: https://github.com/altana-ai/renovate-changelogs-body-demo Same feature branch, same fixture, same workflow, with
At the unit level, the |
|
For completeness, what the demos actually do. Each The fixture pins That gives four cases:
Results and per-run links are in each repo's README. |
Changes
Adds a new
changelogsLocationconfig option with two values:body(default): unchanged behavior, the changelogs/release notes are part of the PR body.comment: the changelogs are posted as a PR comment instead, and the{{{changelogs}}}field of the PR body holds a short notice pointing at the comment.Implementation notes:
getPrBody()swapsgetChangelogs()forgetChangelogsCommentNotice()whenchangelogsLocation=comment, so a customprBodyTemplateneeds no changes.Release Notesviaplatform/comment.ts, which already hashes content in the repo cache, so an unchanged changelog costs no API call.fetchChangeLogs=off), and logs instead of commenting under--dry-run.Context
Motivation: GitHub (and other platforms) seed the squash commit message from the PR body, so today every Renovate PR that carries release notes dumps the whole changelog into the repository history.
In our monorepo we worked around this with a GitHub Actions workflow that lifts the Release Notes section out of the PR body after the fact and re-posts it as a comment.
This option makes that workaround unnecessary.
Please select one of the following:
Happy to open a Discussion first, or to rename the option / change its values, if you'd prefer that.
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Code, unit tests and docs were drafted with Claude Code (Claude Opus 5) and reviewed by me.
Use of AI in replying to PR comments
Who answers review comments:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: