|
| 1 | +## Organization / Actions / Self Hosted Runners API |
| 2 | +[Back to the "Organization API"](../../organization.md) | [Back to the navigation](../../README.md) |
| 3 | + |
| 4 | +# List self-hosted runners for an Organization |
| 5 | + |
| 6 | +https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization |
| 7 | + |
| 8 | +```php |
| 9 | +$runners = $client->api('organization')->runners()->all('KnpLabs'); |
| 10 | +``` |
| 11 | + |
| 12 | +# Get a self-hosted runner for an Organization |
| 13 | + |
| 14 | + https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization |
| 15 | + |
| 16 | +```php |
| 17 | +$runner = $client->api('organization')->runners()->show('KnpLabs', $runnerId); |
| 18 | +``` |
| 19 | + |
| 20 | +# Delete a self-hosted runner from an Organization |
| 21 | + |
| 22 | +https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization |
| 23 | + |
| 24 | +```php |
| 25 | +$client->api('organization')->runners()->remove('KnpLabs', $runnerId); |
| 26 | +``` |
| 27 | + |
| 28 | +# List runner applications for an Organization |
| 29 | + |
| 30 | +https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization |
| 31 | + |
| 32 | +```php |
| 33 | +$applications = $client->api('organization')->selfHostedRunners()->applications('KnpLabs'); |
| 34 | +``` |
| 35 | + |
| 36 | +# List of all runners with Pagination |
| 37 | + |
| 38 | +```php |
| 39 | +$api = $github->api('organization')->runners(); |
| 40 | +$paginator = new Github\ResultPager($github); |
| 41 | +$parameters = array('KnpLabs'); |
| 42 | +$runners = $paginator->fetchAll($api, 'all', $parameters); |
| 43 | + |
| 44 | +do { |
| 45 | + foreach ($runners['runners'] as $runner) { |
| 46 | + // code |
| 47 | + } |
| 48 | + $runners = $paginator->fetchNext(); |
| 49 | +} |
| 50 | +while($paginator->hasNext()); |
| 51 | +``` |
0 commit comments