Skip to content

Commit

Permalink
Merge pull request #77 from FnTm/is-pr-draft
Browse files Browse the repository at this point in the history
Add ability to retrieve draft state of a PR
  • Loading branch information
aaronjwhiteside authored May 9, 2020
2 parents aeb1116 + 38444c2 commit dc04783
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 dc04783

Please sign in to comment.