Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e3ebf6e

Browse filesBrowse files
committed
Merge pull request hub4j#212 from umajeric/master
Added option to edit GitHub release once it is created
2 parents ec450b8 + 76d2831 commit e3ebf6e
Copy full SHA for e3ebf6e

File tree

Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-0
lines changed

‎src/main/java/org/kohsuke/github/GHRelease.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRelease.java
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ public boolean isDraft() {
4545
return draft;
4646
}
4747

48+
public GHRelease setDraft(boolean draft) throws IOException {
49+
edit("draft", draft);
50+
this.draft = draft;
51+
return this;
52+
}
53+
4854
public URL getHtmlUrl() {
4955
return GitHub.parseURL(html_url);
5056
}
@@ -149,6 +155,13 @@ public void delete() throws IOException {
149155
new Requester(root).method("DELETE").to(owner.getApiTailUrl("releases/"+id));
150156
}
151157

158+
/**
159+
* Edit this release.
160+
*/
161+
private void edit(String key, Object value) throws IOException {
162+
new Requester(root)._with(key, value).method("PATCH").to(owner.getApiTailUrl("releases/"+id));
163+
}
164+
152165
private String getApiTailUrl(String end) {
153166
return owner.getApiTailUrl(format("releases/%s/%s",id,end));
154167
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.