Reuse PullRequest only from CreatePullRequest Task
@@ -285,16 +285,6 @@ public class UpgradeDependencyPlugin implements Plugin<Project> {
}
});
- findOpenPullRequestTask.provideOpenPullRequest(task, new Action<OpenPullRequest>() {
- @Override
- public void execute(OpenPullRequest openPullRequest) {
- if (openPullRequest != null) {
- setPullRequestDataToTask(openPullRequest, task);
- }
- }
- });
-
- if (task.getPullRequestSha() != null) {
createPullRequestTask.provideCreatedPullRequest(task, new Action<OpenPullRequest>() {
@Override
public void execute(OpenPullRequest openPullRequest) {
@@ -303,9 +293,9 @@ public class UpgradeDependencyPlugin implements Plugin<Project> {
}
}
});
- }
task.onlyIf(isPullRequestOpen(task));
+ task.onlyIf(wasOpenPullRequestNotFound(findOpenPullRequestTask));
task.onlyIf(wasBuildFileUpdatedSpec(replaceVersionTask));
}
});
