commitBody stays empty albeit "fetchChangeLogs": "branch" #44304
-
How are you running Renovate?Self-hosted Renovate CLI Which platform you running Renovate on?GitLab (.com or self-hosted) Which version of Renovate are you using?"renovateVersion": "43.249.1" Please tell us more about your question or problemAs depicted in Renovate doc, I would like to fetch changelogs for addition to branch commit-messages. These temporary branches acre created by the means of Renovate MRs. I update I am sure this Package Rule is triggered. The changeLog/releaseNotes is attached to Merge Request overview tab, but is never inserted in the commit tab. Only commitBodyTable is inserted ... should I add the directive Logs (if relevant) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The changelog you see in the MR overview tab comes from the PR body template, which is separate from the commit body. To get release notes into the commit body you have to set At commit time, Renovate compiles {
"fetchChangeLogs": "branch",
"commitBody": "{{#if logJSON.hasReleaseNotes}}{{#each logJSON.versions}}{{#if releaseNotes.body}}## {{version}}\n\n{{{releaseNotes.body}}}\n\n{{/if}}{{/each}}{{/if}}"
}Two things to be aware of:
|
Beta Was this translation helpful? Give feedback.
fetchChangeLogs: "branch"is necessary but not sufficient here. It controls when changelogs are fetched (at branch-creation time instead of the default "pr", which is too late for the commit), but it doesn't itself inject anything into the commit message.The changelog you see in the MR overview tab comes from the PR body template, which is separate from the commit body.
To get release notes into the commit body you have to set
commitBodyexplicitly.commitBodyTable: trueonly adds the dependency table, andcommitBody: "{{{body}}}"won't work because body isn't available in the commit-body template context.At commit time, Renovate compiles
commitBodywithlogJSON(the ChangeLogResult) ex…