Skip to main content

runner_labels

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

Overview

Namerunner_labels
TypeResource
Idgithub.actions.runner_labels

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
labelsarray
total_countinteger

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_labels_for_self_hosted_runner_for_reposelectowner, repo, runner_idLists all labels for a 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.
list_labels_for_self_hosted_runner_for_orgselectorg, runner_idLists all labels for a 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.
add_custom_labels_to_self_hosted_runner_for_repoinsertowner, repo, runner_id, labelsAdds custom labels to a self-hosted runner configured in a repository.

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

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
add_custom_labels_to_self_hosted_runner_for_orginsertorg, runner_id, labelsAdds custom labels to a self-hosted runner configured in an organization.

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.
set_custom_labels_for_self_hosted_runner_for_reporeplaceowner, repo, runner_id, labelsRemove all previous custom labels and set the new custom labels for 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.
set_custom_labels_for_self_hosted_runner_for_orgreplaceorg, runner_id, labelsRemove all previous custom labels and set the new custom labels for 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.
remove_custom_label_from_self_hosted_runner_for_repodeleteowner, repo, runner_id, nameRemove a custom label from a self-hosted runner configured
in a repository. Returns the remaining labels from the runner.

This endpoint returns a 404 Not Found status if the custom label is not
present on the runner.

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.
remove_custom_label_from_self_hosted_runner_for_orgdeleteorg, runner_id, nameRemove a custom label from a self-hosted runner configured
in an organization. Returns the remaining labels from the runner.

This endpoint returns a 404 Not Found status if the custom label is not
present on the runner.

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.
remove_all_custom_labels_from_self_hosted_runner_for_repodeleteowner, repo, runner_idRemove all custom labels from a self-hosted runner configured in a
repository. Returns the remaining read-only labels from the runner.

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.
remove_all_custom_labels_from_self_hosted_runner_for_orgdeleteorg, runner_idRemove all custom labels from a self-hosted runner configured in an
organization. Returns the remaining read-only labels from the runner.

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.

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
namestringThe name of a self-hosted runner's custom label.
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.

SELECT examples

Lists all labels for a 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
labels,
total_count
FROM github.actions.runner_labels
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND runner_id = '{{ runner_id }}' -- required
;

INSERT examples

Adds custom labels to a self-hosted runner configured in a repository.

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

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

INSERT INTO github.actions.runner_labels (
labels,
owner,
repo,
runner_id
)
SELECT
'{{ labels }}' /* required */,
'{{ owner }}',
'{{ repo }}',
'{{ runner_id }}'
RETURNING
labels,
total_count
;

REPLACE examples

Remove all previous custom labels and set the new custom labels for 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.

REPLACE github.actions.runner_labels
SET
labels = '{{ labels }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND runner_id = '{{ runner_id }}' --required
AND labels = '{{ labels }}' --required
RETURNING
labels,
total_count;

DELETE examples

Remove a custom label from a self-hosted runner configured
in a repository. Returns the remaining labels from the runner.

This endpoint returns a 404 Not Found status if the custom label is not
present on the runner.

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.

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