diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js index 7eba107767294da24be1e549f850fda659e5cd7f..bdfcd9cb58a6417d1ca1475360853388874b94c6 100644 --- a/lib/workers/pr/index.js +++ b/lib/workers/pr/index.js @@ -16,7 +16,7 @@ async function ensurePr(prConfig) { logger.trace({ config }, 'ensurePr'); // If there is a group, it will use the config of the first upgrade in the array - const { branchName, upgrades } = config; + const { branchName, prTitle, upgrades } = config; // Check if existing PR exists const existingPr = await platform.getBranchPr(branchName); if (existingPr) { @@ -188,7 +188,6 @@ async function ensurePr(prConfig) { } } - const prTitle = handlebars.compile(config.prTitle)(config); let prBody = handlebars.compile(config.prBody)(config); // istanbul ignore if if (config.global && config.global.prBanner) { diff --git a/lib/workers/repository/updates/branchify.js b/lib/workers/repository/updates/branchify.js index ebea4b4ca45bfe055ff2c50daec61b7dd2c2ac76..8806e1d5c32402ac92fdef00d3128295126e0fc3 100644 --- a/lib/workers/repository/updates/branchify.js +++ b/lib/workers/repository/updates/branchify.js @@ -18,7 +18,6 @@ function branchifyUpgrades(config) { warnings.push(upgrade); } else { // Check whether to use a group name - let branchName; if (upgrade.groupName) { logger.debug('Using group branchName template'); logger.debug( @@ -30,13 +29,18 @@ function branchifyUpgrades(config) { .toString() .toLowerCase() .replace(/[^a-z0-9+]+/g, '-'); - branchName = handlebars.compile(upgrade.group.branchName)(upgrade); + upgrade.branchName = handlebars.compile(upgrade.group.branchName)( + upgrade + ); } else { logger.debug('Using regular branchName template'); - branchName = handlebars.compile(upgrade.branchName)(upgrade); + upgrade.branchName = handlebars.compile(upgrade.branchName)(upgrade); } - branchUpgrades[branchName] = branchUpgrades[branchName] || []; - branchUpgrades[branchName] = [upgrade].concat(branchUpgrades[branchName]); + branchUpgrades[upgrade.branchName] = + branchUpgrades[upgrade.branchName] || []; + branchUpgrades[upgrade.branchName] = [upgrade].concat( + branchUpgrades[upgrade.branchName] + ); } } logger.debug(`Returning ${Object.keys(branchUpgrades).length} branch(es)`); diff --git a/lib/workers/repository/updates/generate.js b/lib/workers/repository/updates/generate.js index 869aee389f21171ed4e53b899fae316e2d7afd64..80e01a6c0e91f0bda2ecf0e1b4aa95a22a9a3e24 100644 --- a/lib/workers/repository/updates/generate.js +++ b/lib/workers/repository/updates/generate.js @@ -43,9 +43,8 @@ function generateBranchConfig(branchUpgrades) { // Use templates to generate strings logger.debug( { branchName: upgrade.branchName, prTitle: upgrade.prTitle }, - 'Compiling branchName and prTitle' + 'Compiling prTitle' ); - upgrade.branchName = handlebars.compile(upgrade.branchName)(upgrade); upgrade.prTitle += upgrade.baseBranches && upgrade.baseBranches.length > 1 ? ' ({{baseBranch}})'