Skip to content

Commit 9486dcc

Browse files
Geolim4Nyholm
authored andcommitted
Added "reviews" documentation (#608)
* Added "reviews" documentation * Fixed confusing terms "reviews requests" vs "reviews" * Updated "reviews" doc
1 parent bed18bf commit 9486dcc

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

doc/pull_request/reviews.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Pull Requests / Reviews API
2+
[Back to the "Pull Requests API"](../pull_requests.md) | [Back to the navigation](../README.md)
3+
4+
### List all reviews
5+
6+
```php
7+
$reviewRequests = $client->api('pull_request')->reviews()->all('twbs', 'bootstrap', 12);
8+
```
9+
10+
### Create a review
11+
12+
```php
13+
$client->api('pull_request')->reviews()->create('twbs', 'bootstrap', 12, array(
14+
'event' => 'APPROVE', // Accepted values: APPROVE, REQUEST_CHANGES, COMMENT, see https://developer.github.com/v3/pulls/reviews/#input-1
15+
'body' => 'OK, looks good :)',// Optional, the review body text
16+
'commit_id' => $commitSha, // Optional, default value is HEAD sha
17+
));
18+
```
19+
20+
### Get a review
21+
22+
```php
23+
$client->api('pull_request')->reviews()->show('twbs', 'bootstrap', 12, $reviewId);
24+
```
25+
26+
### Get comment from a review
27+
28+
```php
29+
$client->api('pull_request')->reviews()->comments('twbs', 'bootstrap', 12, $reviewId);
30+
```
31+
32+
### Dismiss a review
33+
**This does not remove the review but dismisses the (dis)approval status of this one**
34+
35+
Note: To dismiss a pull request review on a protected branch, you must be a
36+
repository administrator or be included in the list of people or teams who can dismiss pull request reviews.
37+
38+
```php
39+
$client->api('pull_request')->reviews()->remove('twbs', 'bootstrap', 12, $reviewId, 'Dismiss reason (mandatory)');
40+
```
41+
42+
### Remove a review
43+
44+
```php
45+
$client->api('pull_request')->reviews()->remove('twbs', 'bootstrap', 12, $reviewId);
46+
```

0 commit comments

Comments
 (0)