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); + } }