Skip to content

Commit

Permalink
Add ability to retrieve draft state of a PR
Browse files Browse the repository at this point in the history
  • Loading branch information
FnTm committed Apr 14, 2020
1 parent aeb1116 commit 38444c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ merged | `Boolean` | false
mergeable | `Boolean` | false
mergeCommitSha | `String` | false
maintainerCanModify | `Boolean` | **true** | Accepts `true`, `false` or `'true'`, `'false'`
draft | `Boolean` | false


### Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ public boolean isLocked() {
return pullRequest.isLocked();
}

@Whitelisted
public boolean isDraft() {
return pullRequest.isDraft();
}

@Whitelisted
public MilestoneGroovyObject getMilestone() {
return Optional.ofNullable(pullRequest.getMilestone())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class ExtendedPullRequest extends PullRequest {

private User closedBy;
private boolean locked;
private boolean draft;
private String mergeCommitSha;
private Boolean maintainerCanModify;

Expand All @@ -30,6 +31,14 @@ public void setLocked(final boolean locked) {
this.locked = locked;
}

public boolean isDraft() {
return draft;
}

public void setDraft(final boolean draft) {
this.draft = draft;
}

public String getMergeCommitSha() {
return mergeCommitSha;
}
Expand Down

0 comments on commit 38444c2

Please sign in to comment.