mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
2.2 KiB
2.2 KiB
Working with Self-hosted runners
Create a client
var client = new GitHubClient(....); // More on GitHubClient can be found in "Getting Started"
List Runners
List self-hosted runners for an enterprise
var runners = await client.Actions.SelfHostedRunners.ListAllRunnersForEnterprise("enterprise");
List self-hosted runners for an organization
var runners = await client.Actions.SelfHostedRunners.ListAllRunnersForOrganization("octokit");
List self-hosted runners for a repository
var runners = await client.Actions.SelfHostedRunners.ListAllRunnersForRepository("octokit", "octokit.net");
List Runner Applications
List runner applications for an enterprise
var runnerApplications = await client.Actions.SelfHostedRunners.ListAllRunnerApplicationsForEnterprise("enterprise");
List runner applications for an organization
var runnerApplications = await client.Actions.SelfHostedRunners.ListAllRunnerApplicationsForOrganization("octokit");
List runner applications for a repository
var runnerApplications = await client.Actions.SelfHostedRunners.ListAllRunnerApplicationsForRepository("octokit", "octokit.net");
Create Registration Tokens
Create a registration token for an enterprise
var token = await client.Actions.SelfHostedRunners.CreateEnterpriseRegistrationToken("enterprise");
Create a registration token for an organization
var token = await client.Actions.SelfHostedRunners.CreateOrganizationRegistrationToken("octokit");
Create a registration token for a repository
var token = await client.Actions.SelfHostedRunners.CreateRepositoryRegistrationToken("octokit", "octokit.net");
Delete
Delete a self-hosted runner from an enterprise
await client.Actions.SelfHostedRunners.DeleteEnterpriseRunner("enterprise", runnerId);
Delete a self-hosted runner from an organization
await client.Actions.SelfHostedRunners.DeleteOrganizationRunner("octokit", runnerId);
Delete a self-hosted runner from a repository
await client.Actions.SelfHostedRunners.DeleteRepositoryRunner("octokit", "octokit.net", runnerId);