Skip to main content

org_runner_groups

Creates, updates, deletes, gets or lists an org_runner_groups resource.

Overview

Nameorg_runner_groups
TypeResource
Idgithub.actions.org_runner_groups

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idnumber
namestring
network_configuration_idstringThe identifier of a hosted compute network configuration.
allows_public_repositoriesboolean
defaultboolean
hosted_runners_urlstring
inheritedboolean
inherited_allows_public_repositoriesboolean
restricted_to_workflowsbooleanIf true, the runner group will be restricted to running only the workflows specified in the selected_workflows array.
runners_urlstring
selected_repositories_urlstringLink to the selected repositories resource for this runner group. Not present unless visibility was set to selected
selected_workflowsarrayList of workflows the runner group should be allowed to run. This setting will be ignored unless restricted_to_workflows is set to true.
visibilitystring
workflow_restrictions_read_onlybooleanIf true, the restricted_to_workflows and selected_workflows fields cannot be modified.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_self_hosted_runner_group_for_orgselectorg, runner_group_idGets a specific self-hosted runner group for an organization.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
list_self_hosted_runner_groups_for_orgselectorgper_page, page, visible_to_repositoryLists all self-hosted runner groups configured in an organization and inherited from an enterprise.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
create_self_hosted_runner_group_for_orginsertorg, nameCreates a new self-hosted runner group for an organization.

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
update_self_hosted_runner_group_for_orgupdateorg, runner_group_id, nameUpdates the name and visibility of a self-hosted runner group in an organization.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
delete_self_hosted_runner_group_from_orgdeleteorg, runner_group_idDeletes a self-hosted runner group for an organization.

OAuth tokens and personal access tokens (classic) need the admin:org 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.
runner_group_idintegerUnique identifier of the self-hosted runner group.
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."
visible_to_repositorystringOnly return runner groups that are allowed to be used by this repository.

SELECT examples

Gets a specific self-hosted runner group for an organization.

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

SELECT
id,
name,
network_configuration_id,
allows_public_repositories,
default,
hosted_runners_url,
inherited,
inherited_allows_public_repositories,
restricted_to_workflows,
runners_url,
selected_repositories_url,
selected_workflows,
visibility,
workflow_restrictions_read_only
FROM github.actions.org_runner_groups
WHERE org = '{{ org }}' -- required
AND runner_group_id = '{{ runner_group_id }}' -- required
;

INSERT examples

Creates a new self-hosted runner group for an organization.

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

INSERT INTO github.actions.org_runner_groups (
name,
visibility,
selected_repository_ids,
runners,
allows_public_repositories,
restricted_to_workflows,
selected_workflows,
network_configuration_id,
org
)
SELECT
'{{ name }}' /* required */,
'{{ visibility }}',
'{{ selected_repository_ids }}',
'{{ runners }}',
{{ allows_public_repositories }},
{{ restricted_to_workflows }},
'{{ selected_workflows }}',
'{{ network_configuration_id }}',
'{{ org }}'
RETURNING
id,
name,
network_configuration_id,
allows_public_repositories,
default,
hosted_runners_url,
inherited,
inherited_allows_public_repositories,
restricted_to_workflows,
runners_url,
selected_repositories_url,
selected_workflows,
visibility,
workflow_restrictions_read_only
;

UPDATE examples

Updates the name and visibility of a self-hosted runner group in an organization.

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

UPDATE github.actions.org_runner_groups
SET
name = '{{ name }}',
visibility = '{{ visibility }}',
allows_public_repositories = {{ allows_public_repositories }},
restricted_to_workflows = {{ restricted_to_workflows }},
selected_workflows = '{{ selected_workflows }}',
network_configuration_id = '{{ network_configuration_id }}'
WHERE
org = '{{ org }}' --required
AND runner_group_id = '{{ runner_group_id }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
network_configuration_id,
allows_public_repositories,
default,
hosted_runners_url,
inherited,
inherited_allows_public_repositories,
restricted_to_workflows,
runners_url,
selected_repositories_url,
selected_workflows,
visibility,
workflow_restrictions_read_only;

DELETE examples

Deletes a self-hosted runner group for an organization.

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

DELETE FROM github.actions.org_runner_groups
WHERE org = '{{ org }}' --required
AND runner_group_id = '{{ runner_group_id }}' --required
;