diff --git a/lib/workers/repository/updates/generate.js b/lib/workers/repository/updates/generate.js index 70fa54d6e456e99cc88cfcc39f245509be8a3b3a..92b9150ddf424e6402b6b963688b5b8ef3eca5c2 100644 --- a/lib/workers/repository/updates/generate.js +++ b/lib/workers/repository/updates/generate.js @@ -18,17 +18,18 @@ function generateBranchConfig(branchUpgrades) { if (!depNames.includes(upg.depName)) { depNames.push(upg.depName); } - if (upg.commitMessageExtra) { - const extra = handlebars.compile(upg.commitMessageExtra)(upg); - if (!newValue.includes(extra)) { - newValue.push(extra); - } + if (!newValue.includes(upg.toVersion)) { + newValue.push(upg.toVersion); } }); const groupEligible = depNames.length > 1 || newValue.length > 1 || branchUpgrades[0].lazyGrouping === false; + if (branchUpgrades.length > 1 && !groupEligible) { + // eslint-disable-next-line no-param-reassign + branchUpgrades[0].commitMessageExtra = `to v${newValue[0]}`; + } logger.debug(`groupEligible: ${groupEligible}`); const useGroupSettings = hasGroupName && groupEligible; logger.debug(`useGroupSettings: ${useGroupSettings}`); diff --git a/test/workers/repository/updates/generate.spec.js b/test/workers/repository/updates/generate.spec.js index c8831b80063301e5d9c1340066eaa0095f0d377e..d5455e4a934d204e9f6ffa89073c89b5b347d368 100644 --- a/test/workers/repository/updates/generate.spec.js +++ b/test/workers/repository/updates/generate.spec.js @@ -89,6 +89,7 @@ describe('workers/repository/updates/generate', () => { lazyGrouping: true, foo: 1, newValue: '5.1.2', + toVersion: '5.1.2', group: { foo: 2, }, @@ -106,6 +107,7 @@ describe('workers/repository/updates/generate', () => { lazyGrouping: true, foo: 1, newValue: '5.1.2', + toVersion: '5.1.2', group: { foo: 2, }, @@ -133,6 +135,7 @@ describe('workers/repository/updates/generate', () => { lazyGrouping: true, foo: 1, newValue: '5.1.2', + toVersion: '5.1.2', group: { foo: 2, }, @@ -148,6 +151,7 @@ describe('workers/repository/updates/generate', () => { lazyGrouping: true, foo: 1, newValue: '1.1.0', + toVersion: '1.1.0', group: { foo: 2, },