Skip to main content

self_hosted_runners

Creates, updates, deletes, gets or lists a self_hosted_runners resource.

Overview

Nameself_hosted_runners
TypeResource
Idgithub.actions.self_hosted_runners

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idintegerThe ID of the runner.
namestringThe name of the runner. (example: iMac)
runner_group_idintegerThe ID of the runner group.
busyboolean
ephemeralboolean
labelsarray
osstringThe Operating System of the runner. (example: macos)
statusstringThe status of the runner. (example: online)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_self_hosted_runner_for_reposelectowner, repo, runner_idGets a specific self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
get_self_hosted_runner_for_orgselectorg, runner_idGets a specific self-hosted runner configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.
list_self_hosted_runners_for_reposelectowner, reponame, per_page, pageLists all self-hosted runners configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
list_self_hosted_runners_for_orgselectorgname, per_page, pageLists all self-hosted runners configured in an organization.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.
delete_self_hosted_runner_from_repodeleteowner, repo, runner_idForces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
delete_self_hosted_runner_from_orgdeleteorg, runner_idForces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

Authenticated users must have admin access to the organization to use this endpoint.

OAuth tokens and personal access tokens (classic) need theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
orgstringThe organization name. The name is not case sensitive.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
runner_idintegerUnique identifier of the self-hosted runner.
namestringThe name of a self-hosted runner.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Gets a specific self-hosted runner configured in a repository.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

SELECT
id,
name,
runner_group_id,
busy,
ephemeral,
labels,
os,
status
FROM github.actions.self_hosted_runners
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND runner_id = '{{ runner_id }}' -- required
;

DELETE examples

Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

Authenticated users must have admin access to the repository to use this endpoint.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

DELETE FROM github.actions.self_hosted_runners
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND runner_id = '{{ runner_id }}' --required
;