public static String getHeadBranch(String forkRepositoryName, String headBranch) { return getUserOfForkRepo(forkRepositoryName) + ":" + headBranch; }
String headBranch = BranchUtils.getHeadBranch(task.getForkRepositoryName(), task.getVersionBranch());
String headBranch = BranchUtils.getHeadBranch(task.getForkRepositoryName(), task.getVersionBranch());
public PullRequest createPullRequest(CreatePullRequestTask task, GitHubApi gitHubApi) throws IOException { if (task.isDryRun()) { LOG.lifecycle(" Skipping pull request creation due to dryRun = true"); return null; } String headBranch = BranchUtils.getHeadBranch(task.getForkRepositoryName(), task.getVersionBranch()); IncubatingWarning.warn("creating pull requests"); LOG.lifecycle(" Creating a pull request of title '{}' in repository '{}' between base = '{}' and head = '{}'.", task.getPullRequestTitle(), task.getUpstreamRepositoryName(), task.getBaseBranch(), headBranch); String body = "{" + " \"title\": \"" + task.getPullRequestTitle() + "\"," + " \"body\": \"" + task.getPullRequestDescription() + "\"," + " \"head\": \"" + headBranch + "\"," + " \"base\": \"" + task.getBaseBranch() + "\"," + " \"maintainer_can_modify\": true" + "}"; String response = gitHubApi.post("/repos/" + task.getUpstreamRepositoryName() + "/pulls", body); JsonObject pullRequest = Jsoner.deserialize(response, new JsonObject()); return toPullRequest(pullRequest); } }
public static String getHeadBranch(String forkRepositoryName, String headBranch) { return getUserOfForkRepo(forkRepositoryName) + ":" + headBranch; }
public PullRequest createPullRequest(CreatePullRequestTask task, GitHubApi gitHubApi) throws IOException { if (task.isDryRun()) { LOG.lifecycle(" Skipping pull request creation due to dryRun = true"); return null; } String headBranch = BranchUtils.getHeadBranch(task.getForkRepositoryName(), task.getVersionBranch()); IncubatingWarning.warn("creating pull requests"); LOG.lifecycle(" Creating a pull request of title '{}' in repository '{}' between base = '{}' and head = '{}'.", task.getPullRequestTitle(), task.getUpstreamRepositoryName(), task.getBaseBranch(), headBranch); String body = "{" + " \"title\": \"" + task.getPullRequestTitle() + "\"," + " \"body\": \"" + task.getPullRequestDescription() + "\"," + " \"head\": \"" + headBranch + "\"," + " \"base\": \"" + task.getBaseBranch() + "\"," + " \"maintainer_can_modify\": true" + "}"; String response = gitHubApi.post("/repos/" + task.getUpstreamRepositoryName() + "/pulls", body); JsonObject pullRequest = Jsoner.deserialize(response, new JsonObject()); return toPullRequest(pullRequest); } }