Skip to content
Snippets Groups Projects
Commit 84198801 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

Refactor PR existed logic

parent 75b6a898
Branches
No related tags found
No related merge requests found
...@@ -59,13 +59,13 @@ function updateDependency(depType, depName, currentVersion, nextVersion) { ...@@ -59,13 +59,13 @@ function updateDependency(depType, depName, currentVersion, nextVersion) {
} else { } else {
prTitle = config.templates.prTitleMinor({ depType, depName, currentVersion, nextVersion, nextVersionMajor }); prTitle = config.templates.prTitleMinor({ depType, depName, currentVersion, nextVersion, nextVersionMajor });
} }
// Check if same PR already exists or existed // Check if same PR already existed and skip if so
return github.checkForClosedPr(branchName, prTitle).then((prExisted) => { return github.checkForClosedPr(branchName, prTitle).then((prExisted) => {
if (!prExisted) { if (prExisted) {
return writeUpdates(depType, depName, branchName, prTitle, currentVersion, nextVersion);
} else {
console.log(`${depName}: Skipping due to existing PR found.`); console.log(`${depName}: Skipping due to existing PR found.`);
return;
} }
return writeUpdates(depType, depName, branchName, prTitle, currentVersion, nextVersion);
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment