Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.66 KB

reviews.md

File metadata and controls

53 lines (38 loc) · 1.66 KB

Pull Requests / Reviews API

Back to the "Pull Requests API" | Back to the navigation

Wraps GitHub Pull Request Reviews API.

List all reviews

$reviewRequests = $client->api('pull_request')->reviews()->all('twbs', 'bootstrap', 12);

Create a review

$client->api('pull_request')->reviews()->create('twbs', 'bootstrap', 12, array(                  
    'event' => 'APPROVE', // Accepted values: APPROVE, REQUEST_CHANGES, COMMENT, see https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request
    'body' => 'OK, looks good :)',// Optional, the review body text
    'commit_id' => $commitSha, // Optional, default value is HEAD sha
));

Get a review

$client->api('pull_request')->reviews()->show('twbs', 'bootstrap', 12, $reviewId);

Get comment from a review

$client->api('pull_request')->reviews()->comments('twbs', 'bootstrap', 12, $reviewId);

Dismiss a review

This does not remove the review but dismisses the (dis)approval status of this one

Note: To dismiss a pull request review on a protected branch, you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.

$client->api('pull_request')->reviews()->remove('twbs', 'bootstrap', 12, $reviewId, 'Dismiss reason (mandatory)');

Remove a review

$client->api('pull_request')->reviews()->remove('twbs', 'bootstrap', 12, $reviewId);

Update a review

$client->api('pull_request')->reviews()->update('twbs', 'bootstrap', 12, $reviewId, 'Review body (mandatory)')