Add support for draft pull requests

See https://developer.github.com/v3/pulls/#input
and https://help.github.com/en/articles/about-pull-requests#draft-pull-requests

Note that it requires the use of a github api preview: https://developer.github.com/v3/previews/#draft-pull-requests
This commit is contained in:
Vincent Behar
2019-07-11 11:09:39 +02:00
parent 3ae8ee8ddb
commit e133afec86
3 changed files with 35 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ public class GHPullRequest extends GHIssue {
// details that are only available when obtained from ID
private GHUser merged_by;
private int review_comments, additions, commits;
private boolean merged, maintainer_can_modify;
private boolean merged, maintainer_can_modify, draft;
private Boolean mergeable;
private int deletions;
private String mergeable_state;
@@ -187,6 +187,11 @@ public class GHPullRequest extends GHIssue {
return maintainer_can_modify;
}
public boolean isDraft() throws IOException {
populate();
return draft;
}
/**
* Is this PR mergeable?
*