From df8bebe10d62cdfd11280f596b9fe53b851da07b Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Mon, 3 Sep 2018 21:29:23 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20log=20pr=20body=20change=20only=20i?= =?UTF-8?q?f=20branch=20didn=E2=80=99t=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/workers/branch/index.js | 6 +++--- lib/workers/pr/index.js | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/workers/branch/index.js b/lib/workers/branch/index.js index 858ee3a068..0a4e718d01 100644 --- a/lib/workers/branch/index.js +++ b/lib/workers/branch/index.js @@ -178,11 +178,11 @@ async function processBranch(branchConfig, packageFiles) { } } - const committedFiles = await commitFilesToBranch(config); + config.committedFiles = await commitFilesToBranch(config); // istanbul ignore if if ( config.updateType === 'lockFileMaintenance' && - !committedFiles && + !config.committedFiles && !config.parentBranch && branchExists ) { @@ -192,7 +192,7 @@ async function processBranch(branchConfig, packageFiles) { await platform.deleteBranch(config.branchName); return 'done'; } - if (!(committedFiles || branchExists)) { + if (!(config.committedFiles || branchExists)) { return 'no-work'; } diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js index aba4a1a38a..1cf84ff4df 100644 --- a/lib/workers/pr/index.js +++ b/lib/workers/pr/index.js @@ -233,7 +233,7 @@ async function ensurePr(prConfig) { }, 'PR title changed' ); - } else { + } else if (!config.committedFiles) { logger.debug( { prTitle, @@ -245,7 +245,10 @@ async function ensurePr(prConfig) { } await platform.updatePr(existingPr.number, prTitle, prBody); - logger.info({ pr: existingPr.number }, `PR updated`); + logger.info( + { committedFiles: config.committedFiles, pr: existingPr.number }, + `PR updated` + ); return existingPr; } logger.debug({ branchName, prTitle }, `Creating PR`); -- GitLab