mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-27 07:50:47 +00:00
c3325bcea8
The onboarding and config migration workers each had their own copy of the dryRun guard plus `scm.commitAndPush()` call that writes a Renovate config file to its own branch, and only `onboarding/branch/create.ts` compiled `commitBody` and `commitTrailers`. Add `model/commit-config-file.ts` with `commitConfigFile()`, which owns the dryRun guard (the log line stays per call site through `dryRunMessage`), the commit body and trailer compilation and the `commitAndPush()` call. Its `getFiles` callback runs only after the guard passes, so a dry run still neither checks out a branch nor runs Prettier. The same file exports `createConfigFileCommitMessage()`, which replaces the duplicated "create a `CommitMessage` and set its subject" step of the two commit message factories. Extract the body and trailer compilation into `model/commit-body.ts` as `compileCommitBodyAndTrailers()`, now used by `update/branch/index.ts` as well. Move `getOnboardingPrTitle()` into `onboarding/common.ts` so the onboarding branch create, rebase and PR workers share it. Behaviour changes: * Config migration commits and the onboarding rebase commit now honour `commitBody` and `commitTrailers`, as the onboarding create commit already did. As there, only `gitAuthor` is exposed to those templates. * `trailers` is left out of the `commitAndPush()` call when no trailer is configured, instead of being sent as an empty array by the onboarding create commit. Both the Git and the Gerrit commit paths treat the two the same. * The `commitMessage` trace log is now JSON stringified for the onboarding create commit, matching the branch worker, and a `commitTrailers` trace log was added for all four commits.