|
| 1 | +## Repo / Checks runs API |
| 2 | +[Back to the "Repos API"](../repos.md) | [Back to the navigation](../README.md) |
| 3 | + |
| 4 | +### Create a check run |
| 5 | + |
| 6 | +[Visit GitHub for a full of list of parameters and their descriptions.](https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-run) |
| 7 | + |
| 8 | +```php |
| 9 | +$params = [ |
| 10 | + 'name' => 'my check', # required |
| 11 | + 'head_sha' => $commitSha, # required |
| 12 | + 'status' => 'queued', |
| 13 | + 'output' => [/*...*/] |
| 14 | +]; |
| 15 | +$check = $client->api('repo')->checkRuns()->create('KnpLabs', 'php-github-api', $params); |
| 16 | +``` |
| 17 | + |
| 18 | +### Get a check run |
| 19 | + |
| 20 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#get-a-check-run |
| 21 | + |
| 22 | +```php |
| 23 | +$check = $client->api('repo')->checkRuns()->show('KnpLabs', 'php-github-api', $checkRunId); |
| 24 | +``` |
| 25 | + |
| 26 | +### Update an existing check run |
| 27 | + |
| 28 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#update-a-check-run |
| 29 | + |
| 30 | +```php |
| 31 | +$params = [ |
| 32 | + 'name' => 'my check', |
| 33 | + 'status' => 'in_progress', |
| 34 | + 'output' => [/*...*/] |
| 35 | +]; |
| 36 | +$check = $client->api('repo')->checkRuns()->update('KnpLabs', 'php-github-api', $checkRunId, $params); |
| 37 | +``` |
| 38 | + |
| 39 | +### List check run annotations |
| 40 | + |
| 41 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#list-check-run-annotations |
| 42 | + |
| 43 | +```php |
| 44 | +$annotations = $client->api('repo')->checkRuns()->annotations('KnpLabs', 'php-github-api', $checkRunId); |
| 45 | +``` |
| 46 | + |
| 47 | +### List check runs for a check suite |
| 48 | + |
| 49 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#list-check-runs-in-a-check-suite |
| 50 | + |
| 51 | +```php |
| 52 | +$params = [/*...*/]; |
| 53 | +$checks = $client->api('repo')->checkRuns()->allForCheckSuite('KnpLabs', 'php-github-api', $checkSuiteId, $params); |
| 54 | +``` |
| 55 | + |
| 56 | +### List check runs for a Git reference |
| 57 | + |
| 58 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#list-check-runs-for-a-git-reference |
| 59 | + |
| 60 | +```php |
| 61 | +$params = [/*...*/]; |
| 62 | +$checks = $client->api('repo')->checkRuns()->allForReference('KnpLabs', 'php-github-api', $reference, $params); |
| 63 | +``` |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
0 commit comments