Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for draft pullrequests #807

Open
acrobat opened this issue Aug 13, 2019 · 0 comments

Comments

@acrobat
Copy link
Collaborator

commented Aug 13, 2019

public function create($username, $repository, array $params)
{
// Two ways to create PR, using issue or title
if (!isset($params['issue']) && !isset($params['title'])) {
throw new MissingArgumentException(['issue', 'title']);
}
if (!isset($params['base'], $params['head'])) {
throw new MissingArgumentException(['base', 'head']);
}
// If `issue` is not sent, then `body` must be sent
if (!isset($params['issue']) && !isset($params['body'])) {
throw new MissingArgumentException(['issue', 'body']);
}
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls', $params);
}

We should check the $params array if an option draft exists and is set to true. If so we should set the preview accept-header application/vnd.github.shadow-cat-preview+json

See: https://developer.github.com/changes/2019-02-14-draft-pull-requests/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.