diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index d18d6dd44335e8..2ba14ca9de3e8e 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -448,6 +448,11 @@ Check out the default value for `commitMessage` to understand how this field is This is used to alter `commitMessage` and `prTitle` without needing to copy/paste the whole string. The "extra" is usually an identifier of the new version, e.g. "to v1.3.2" or "to tag 9.2". +## commitMessageLowerCase + +With `semanticCommits` pr- and commit-titles will by default (`"auto"`) be converted to all-lowercase. +Set this to `"never"` to leave the titles untouched, allowing uppercase characters in semantic commit titles. + ## commitMessagePrefix This is used to alter `commitMessage` and `prTitle` without needing to copy/paste the whole string. diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index a020d9dae72157..0e05c187ba51cf 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1549,6 +1549,13 @@ const options: RenovateOptions[] = [ type: 'string', default: 'deps', }, + { + name: 'commitMessageLowerCase', + description: 'Lowercase PR- and commit titles.', + type: 'string', + allowedValues: ['auto', 'never'], + default: 'auto', + }, // PR Behaviour { name: 'rollbackPrs', diff --git a/lib/config/types.ts b/lib/config/types.ts index 4286c5a512e242..ad5908b00e24b9 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -78,6 +78,7 @@ export interface RenovateSharedConfig { automergeSchedule?: string[]; semanticCommits?: 'auto' | 'enabled' | 'disabled'; semanticCommitScope?: string | null; + commitMessageLowerCase?: 'auto' | 'never'; semanticCommitType?: string; suppressNotifications?: string[]; timezone?: string; diff --git a/lib/modules/platform/azure/index.ts b/lib/modules/platform/azure/index.ts index 3790df6c7524fa..def6948ea10b12 100644 --- a/lib/modules/platform/azure/index.ts +++ b/lib/modules/platform/azure/index.ts @@ -307,7 +307,9 @@ export async function findPr({ ); if (prTitle) { - prsFiltered = prsFiltered.filter((item) => item.title === prTitle); + prsFiltered = prsFiltered.filter( + (item) => item.title.toUpperCase() === prTitle.toUpperCase() + ); } switch (state) { diff --git a/lib/modules/platform/bitbucket-server/index.ts b/lib/modules/platform/bitbucket-server/index.ts index 5ce4aa5e9a443f..9da5a7fff7a2eb 100644 --- a/lib/modules/platform/bitbucket-server/index.ts +++ b/lib/modules/platform/bitbucket-server/index.ts @@ -289,7 +289,7 @@ const isRelevantPr = (branchName: string, prTitle: string | null | undefined, state: string) => (p: Pr): boolean => p.sourceBranch === branchName && - (!prTitle || p.title === prTitle) && + (!prTitle || p.title.toUpperCase() === prTitle.toUpperCase()) && matchesState(p.state, state); // TODO: coverage (#9624) diff --git a/lib/modules/platform/bitbucket/index.ts b/lib/modules/platform/bitbucket/index.ts index 17fe0cd5bc36a0..b12eb09a114dae 100644 --- a/lib/modules/platform/bitbucket/index.ts +++ b/lib/modules/platform/bitbucket/index.ts @@ -293,7 +293,7 @@ export async function findPr({ const pr = prList.find( (p) => p.sourceBranch === branchName && - (!prTitle || p.title === prTitle) && + (!prTitle || p.title.toUpperCase() === prTitle.toUpperCase()) && matchesState(p.state, state) ); if (pr) { diff --git a/lib/modules/platform/codecommit/index.ts b/lib/modules/platform/codecommit/index.ts index 0e93116c889c0b..6ce173083c4901 100644 --- a/lib/modules/platform/codecommit/index.ts +++ b/lib/modules/platform/codecommit/index.ts @@ -208,7 +208,9 @@ export async function findPr({ ); if (prTitle) { - prsFiltered = prsFiltered.filter((item) => item.title === prTitle); + prsFiltered = prsFiltered.filter( + (item) => item.title.toUpperCase() === prTitle.toUpperCase() + ); } switch (state) { diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts index 1fb1e521a00e74..a82a532eb04a29 100644 --- a/lib/modules/platform/github/index.ts +++ b/lib/modules/platform/github/index.ts @@ -716,7 +716,7 @@ export async function findPr({ return false; } - if (prTitle && prTitle !== p.title) { + if (prTitle && prTitle.toUpperCase() !== p.title.toUpperCase()) { return false; } diff --git a/lib/modules/platform/gitlab/index.ts b/lib/modules/platform/gitlab/index.ts index 24b69b9865ed25..eb3af69a208e34 100644 --- a/lib/modules/platform/gitlab/index.ts +++ b/lib/modules/platform/gitlab/index.ts @@ -752,7 +752,7 @@ export async function findPr({ prList.find( (p: { sourceBranch: string; title: string; state: string }) => p.sourceBranch === branchName && - (!prTitle || p.title === prTitle) && + (!prTitle || p.title.toUpperCase() === prTitle.toUpperCase()) && matchesState(p.state, state) ) ?? null ); diff --git a/lib/workers/repository/updates/generate.ts b/lib/workers/repository/updates/generate.ts index 3dd6b922615837..e02cf5012b7c20 100644 --- a/lib/workers/repository/updates/generate.ts +++ b/lib/workers/repository/updates/generate.ts @@ -226,7 +226,7 @@ export function generateBranchConfig( regEx(/to vv(\d)/), 'to v$1' ); - if (upgrade.toLowerCase) { + if (upgrade.toLowerCase && upgrade.commitMessageLowerCase !== 'never') { // We only need to lowercase the first line const splitMessage = upgrade.commitMessage.split(newlineRegex); splitMessage[0] = splitMessage[0].toLowerCase(); @@ -249,7 +249,7 @@ export function generateBranchConfig( ); throw new Error(CONFIG_SECRETS_EXPOSED); } - if (upgrade.toLowerCase) { + if (upgrade.toLowerCase && upgrade.commitMessageLowerCase !== 'never') { upgrade.prTitle = upgrade.prTitle.toLowerCase(); } } else {