From a6ca9ce1714202de4f3f0a901ca1611968f5ab6e Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@keylocation.sg> Date: Sat, 7 Jan 2017 21:55:08 +0100 Subject: [PATCH] ensurePr --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index e42d9aca68..ebdb0e694d 100644 --- a/src/index.js +++ b/src/index.js @@ -92,14 +92,14 @@ function updateDependency(depType, depName, currentVersion, nextVersion) { const newPackageContents = JSON.stringify(currentFileContent, null, 2) + '\n'; return github.writeFile(branchName, currentSHA, packageFile, newPackageContents, commitMessage) .then(() => { - return createOrUpdatePullRequest(branchName, prTitle, prBody); + return ensurePr(branchName, prTitle, prBody); }); } else { if (config.verbose) { console.log(`${depName} was already up-to-date in branch ${branchName}`); } // File was up to date. Ensure PR - return createOrUpdatePullRequest(branchName, prTitle, prBody); + return ensurePr(branchName, prTitle, prBody); } }); }) @@ -109,7 +109,7 @@ function updateDependency(depType, depName, currentVersion, nextVersion) { }); } -function createOrUpdatePullRequest(branchName, prTitle, prBody) { +function ensurePr(branchName, prTitle, prBody) { return github.getPr(branchName).then(pr => { if (pr) { if (pr.title === prTitle && pr.body === prBody) { -- GitLab