From d145ad8f47741ca390ba10b3320ac3ac41f48c95 Mon Sep 17 00:00:00 2001 From: vanjikumaran Date: Mon, 24 Feb 2014 17:00:11 +0530 Subject: [PATCH] Created new method to automate the merge --- src/main/java/org/kohsuke/github/GHRepository.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index c1146f8e4b..43ea4e78a1 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -822,4 +822,15 @@ public boolean equals(Object obj) { String getApiTailUrl(String tail) { return "/repos/" + owner.login + "/" + name +'/'+tail; } + + /** + * Merge a pull request(Automating the Merge button). + * + * @return + * Merged repository that belong to you. + */ + public GHRepository mergePullRequest(int id) throws IOException { + + return new Requester(root).method("PUT").to("/repos/" + owner.login + "/" + name +"/"+ id+ "/merge", GHRepository.class).wrap(root); + } }