Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.57 KB

self_hosted_runners.md

File metadata and controls

51 lines (36 loc) · 1.57 KB

Organization / Actions / Self Hosted Runners API

Back to the "Organization API" | Back to the navigation

List self-hosted runners for an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization

$runners = $client->api('organization')->runners()->all('KnpLabs');

Get a self-hosted runner for an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization

$runner = $client->api('organization')->runners()->show('KnpLabs', $runnerId);

Delete a self-hosted runner from an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization

$client->api('organization')->runners()->remove('KnpLabs', $runnerId);

List runner applications for an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization

$applications = $client->api('organization')->selfHostedRunners()->applications('KnpLabs');

List of all runners with Pagination

$api = $github->api('organization')->runners();
$paginator  = new Github\ResultPager($github);
$parameters = array('KnpLabs');
$runners = $paginator->fetchAll($api, 'all', $parameters);

do {
    foreach ($runners['runners'] as $runner) {
        // code
    }
    $runners = $paginator->fetchNext();
}
while($paginator->hasNext());