self_hosted_runners
Creates, updates, deletes, gets or lists a self_hosted_runners resource.
Overview
| Name | self_hosted_runners |
| Type | Resource |
| Id | github.actions.self_hosted_runners |
Fields
The following fields are returned by SELECT queries:
- get_self_hosted_runner_for_repo
- get_self_hosted_runner_for_org
- list_self_hosted_runners_for_repo
- list_self_hosted_runners_for_org
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The ID of the runner. |
name | string | The name of the runner. (example: iMac) |
runner_group_id | integer | The ID of the runner group. |
busy | boolean | |
ephemeral | boolean | |
labels | array | |
os | string | The Operating System of the runner. (example: macos) |
status | string | The status of the runner. (example: online) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The ID of the runner. |
name | string | The name of the runner. (example: iMac) |
runner_group_id | integer | The ID of the runner group. |
busy | boolean | |
ephemeral | boolean | |
labels | array | |
os | string | The Operating System of the runner. (example: macos) |
status | string | The status of the runner. (example: online) |
Response
| Name | Datatype | Description |
|---|---|---|
runners | array | |
total_count | integer |
Response
| Name | Datatype | Description |
|---|---|---|
runners | array | |
total_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_self_hosted_runner_for_repo | select | owner, repo, runner_id | 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. | |
get_self_hosted_runner_for_org | select | org, runner_id | Gets 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_repo | select | owner, repo | name, per_page, page | Lists 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_org | select | org | name, per_page, page | Lists 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_repo | delete | owner, repo, runner_id | 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_self_hosted_runner_from_org | delete | org, runner_id | Forces 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 the admin: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.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
runner_id | integer | Unique identifier of the self-hosted runner. |
name | string | The name of a self-hosted runner. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_self_hosted_runner_for_repo
- get_self_hosted_runner_for_org
- list_self_hosted_runners_for_repo
- list_self_hosted_runners_for_org
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
;
Gets 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.
SELECT
id,
name,
runner_group_id,
busy,
ephemeral,
labels,
os,
status
FROM github.actions.self_hosted_runners
WHERE org = '{{ org }}' -- required
AND runner_id = '{{ runner_id }}' -- required
;
Lists 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.
SELECT
runners,
total_count
FROM github.actions.self_hosted_runners
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND name = '{{ name }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Lists 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.
SELECT
runners,
total_count
FROM github.actions.self_hosted_runners
WHERE org = '{{ org }}' -- required
AND name = '{{ name }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
DELETE examples
- delete_self_hosted_runner_from_repo
- delete_self_hosted_runner_from_org
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
;
Forces 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.
DELETE FROM github.actions.self_hosted_runners
WHERE org = '{{ org }}' --required
AND runner_id = '{{ runner_id }}' --required
;