Локальные средства выполнения тестов
Используйте REST API для взаимодействия с локальными средствами выполнения в GitHub Actions.
Сведения о локальных средствах выполнения в GitHub Actions
С помощью REST API можно регистрировать, просматривать и удалять локальные средства выполнения в GitHub Actions. Локальные средства выполнения позволяют размещать собственные средства выполнения и настраивать среду, используемую для выполнения заданий в рабочих процессах GitHub Actions. Дополнительные сведения см. в разделе Размещение собственных средств выполнения.
Эти конечные точки доступны для пользователей, прошедших проверку подлинности, OAuth Apps и GitHub Apps. Маркерам доступа требуется repo
область для закрытых репозиториев и public_repo
область для репозиториев public. GitHub Apps должно иметь administration
разрешение для репозиториев и organization_self_hosted_runners
разрешение для организаций. Пользователи, прошедшие проверку подлинности, должны иметь административный доступ к репозиториям или организациям или manage_runners:enterprise
области использования этих конечных точек предприятиями.
List self-hosted runners for an organization
Lists all self-hosted runners configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "List self-hosted runners for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
Параметры запроса |
Имя, Тип, Описание |
per_page integer The number of results per page (max 100). Значение по умолчанию: |
page integer Page number of the results to fetch. Значение по умолчанию: |
Коды состояния HTTP-ответа для "List self-hosted runners for an organization"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List self-hosted runners for an organization"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners
Response
Status: 200
{
"total_count": 2,
"runners": [
{
"id": 23,
"name": "linux_runner",
"os": "linux",
"status": "online",
"busy": true,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 11,
"name": "Linux",
"type": "read-only"
}
]
},
{
"id": 24,
"name": "mac_runner",
"os": "macos",
"status": "offline",
"busy": false,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
]
}
List runner applications for an organization
Lists binaries for the runner application that you can download and run.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "List runner applications for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
Коды состояния HTTP-ответа для "List runner applications for an organization"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List runner applications for an organization"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/downloads
Response
Status: 200
[
{
"os": "osx",
"architecture": "x64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz",
"filename": "actions-runner-osx-x64-2.164.0.tar.gz"
},
{
"os": "linux",
"architecture": "x64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz",
"filename": "actions-runner-linux-x64-2.164.0.tar.gz"
},
{
"os": "linux",
"architecture": "arm",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz",
"filename": "actions-runner-linux-arm-2.164.0.tar.gz"
},
{
"os": "win",
"architecture": "x64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip",
"filename": "actions-runner-win-x64-2.164.0.zip"
},
{
"os": "linux",
"architecture": "arm64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz",
"filename": "actions-runner-linux-arm64-2.164.0.tar.gz"
}
]
Create a registration token for an organization
Returns a token that you can pass to the config
script. The token expires after one hour.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Example using registration token
Configure your self-hosted runner, replacing TOKEN
with the registration token provided by this endpoint.
./config.sh --url https://github.com/octo-org --token TOKEN
Параметры для "Create a registration token for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
Коды состояния HTTP-ответа для "Create a registration token for an organization"
Код состояния | Описание |
---|---|
201 | Created |
Примеры кода для "Create a registration token for an organization"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/registration-token
Response
Status: 201
{
"token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-22T12:13:35.123-08:00"
}
Create a remove token for an organization
Returns a token that you can pass to the config
script to remove a self-hosted runner from an organization. The token expires after one hour.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Example using remove token
To remove your self-hosted runner from an organization, replace TOKEN
with the remove token provided by this
endpoint.
./config.sh remove --token TOKEN
Параметры для "Create a remove token for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
Коды состояния HTTP-ответа для "Create a remove token for an organization"
Код состояния | Описание |
---|---|
201 | Created |
Примеры кода для "Create a remove token for an organization"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/remove-token
Response
Status: 201
{
"token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-29T12:13:35.123-08:00"
}
Get a self-hosted runner for an organization
Gets a specific self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "Get a self-hosted runner for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "Get a self-hosted runner for an organization"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "Get a self-hosted runner for an organization"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID
Response
Status: 200
{
"id": 23,
"name": "MBP",
"os": "macos",
"status": "online",
"busy": true,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Delete a self-hosted runner from an organization
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.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "Delete a self-hosted runner from an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "Delete a self-hosted runner from an organization"
Код состояния | Описание |
---|---|
204 | No Content |
Примеры кода для "Delete a self-hosted runner from an organization"
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID
Response
Status: 204
List labels for a self-hosted runner for an organization
Lists all labels for a self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "List labels for a self-hosted runner for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "List labels for a self-hosted runner for an organization"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
Примеры кода для "List labels for a self-hosted runner for an organization"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Add custom labels to a self-hosted runner for an organization
Add custom labels to a self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "Add custom labels to a self-hosted runner for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Параметры запроса |
Имя, Тип, Описание |
labels array of strings ОбязательноThe names of the custom labels to add to the runner. |
Коды состояния HTTP-ответа для "Add custom labels to a self-hosted runner for an organization"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Add custom labels to a self-hosted runner for an organization"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Set custom labels for a self-hosted runner for an organization
Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "Set custom labels for a self-hosted runner for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Параметры запроса |
Имя, Тип, Описание |
labels array of strings ОбязательноThe names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. |
Коды состояния HTTP-ответа для "Set custom labels for a self-hosted runner for an organization"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Set custom labels for a self-hosted runner for an organization"
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Remove all custom labels from a self-hosted runner for an organization
Remove all custom labels from a self-hosted runner configured in an organization. Returns the remaining read-only labels from the runner.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "Remove all custom labels from a self-hosted runner for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "Remove all custom labels from a self-hosted runner for an organization"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
Примеры кода для "Remove all custom labels from a self-hosted runner for an organization"
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels
Response
Status: 200
{
"total_count": 3,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
}
]
}
Remove a custom label from a self-hosted runner for an organization
Remove 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.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
Параметры для "Remove a custom label from a self-hosted runner for an organization"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
org string ОбязательноThe organization name. 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's custom label. |
Коды состояния HTTP-ответа для "Remove a custom label from a self-hosted runner for an organization"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Remove a custom label from a self-hosted runner for an organization"
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels/NAME
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
List self-hosted runners for a repository
Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the repo
scope to use this endpoint.
Параметры для "List self-hosted runners for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
Параметры запроса |
Имя, Тип, Описание |
per_page integer The number of results per page (max 100). Значение по умолчанию: |
page integer Page number of the results to fetch. Значение по умолчанию: |
Коды состояния HTTP-ответа для "List self-hosted runners for a repository"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List self-hosted runners for a repository"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners
Response
Status: 200
{
"total_count": 2,
"runners": [
{
"id": 23,
"name": "linux_runner",
"os": "linux",
"status": "online",
"busy": true,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 11,
"name": "Linux",
"type": "read-only"
}
]
},
{
"id": 24,
"name": "mac_runner",
"os": "macos",
"status": "offline",
"busy": false,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
]
}
List runner applications for a repository
Lists binaries for the runner application that you can download and run.
You must authenticate using an access token with the repo
scope to use this endpoint.
Параметры для "List runner applications for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
Коды состояния HTTP-ответа для "List runner applications for a repository"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "List runner applications for a repository"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/downloads
Response
Status: 200
[
{
"os": "osx",
"architecture": "x64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz",
"filename": "actions-runner-osx-x64-2.164.0.tar.gz"
},
{
"os": "linux",
"architecture": "x64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz",
"filename": "actions-runner-linux-x64-2.164.0.tar.gz"
},
{
"os": "linux",
"architecture": "arm",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz",
"filename": "actions-runner-linux-arm-2.164.0.tar.gz"
},
{
"os": "win",
"architecture": "x64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip",
"filename": "actions-runner-win-x64-2.164.0.zip"
},
{
"os": "linux",
"architecture": "arm64",
"download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz",
"filename": "actions-runner-linux-arm64-2.164.0.tar.gz"
}
]
Create a registration token for a repository
Returns a token that you can pass to the config
script. The token expires after one hour. You must authenticate
using an access token with the repo
scope to use this endpoint.
Example using registration token
Configure your self-hosted runner, replacing TOKEN
with the registration token provided by this endpoint.
./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN
Параметры для "Create a registration token for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
Коды состояния HTTP-ответа для "Create a registration token for a repository"
Код состояния | Описание |
---|---|
201 | Created |
Примеры кода для "Create a registration token for a repository"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/registration-token
Response
Status: 201
{
"token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-22T12:13:35.123-08:00"
}
Create a remove token for a repository
Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.
You must authenticate using an access token with the repo
scope to use this endpoint.
Example using remove token
To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.
./config.sh remove --token TOKEN
Параметры для "Create a remove token for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
Коды состояния HTTP-ответа для "Create a remove token for a repository"
Код состояния | Описание |
---|---|
201 | Created |
Примеры кода для "Create a remove token for a repository"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/remove-token
Response
Status: 201
{
"token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-29T12:13:35.123-08:00"
}
Get a self-hosted runner for a repository
Gets a specific self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Параметры для "Get a self-hosted runner for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "Get a self-hosted runner for a repository"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "Get a self-hosted runner for a repository"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID
Response
Status: 200
{
"id": 23,
"name": "MBP",
"os": "macos",
"status": "online",
"busy": true,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Delete a self-hosted runner from a repository
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.
You must authenticate using an access token with the repo
scope to use this endpoint.
Параметры для "Delete a self-hosted runner from a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "Delete a self-hosted runner from a repository"
Код состояния | Описание |
---|---|
204 | No Content |
Примеры кода для "Delete a self-hosted runner from a repository"
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID
Response
Status: 204
List labels for a self-hosted runner for a repository
Lists all labels for a self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Параметры для "List labels for a self-hosted runner for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "List labels for a self-hosted runner for a repository"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
Примеры кода для "List labels for a self-hosted runner for a repository"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Add custom labels to a self-hosted runner for a repository
Add custom labels to a self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Параметры для "Add custom labels to a self-hosted runner for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Параметры запроса |
Имя, Тип, Описание |
labels array of strings ОбязательноThe names of the custom labels to add to the runner. |
Коды состояния HTTP-ответа для "Add custom labels to a self-hosted runner for a repository"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Add custom labels to a self-hosted runner for a repository"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Set custom labels for a self-hosted runner for a repository
Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in a repository.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Параметры для "Set custom labels for a self-hosted runner for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Параметры запроса |
Имя, Тип, Описание |
labels array of strings ОбязательноThe names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. |
Коды состояния HTTP-ответа для "Set custom labels for a self-hosted runner for a repository"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Set custom labels for a self-hosted runner for a repository"
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}
Remove all custom labels from a self-hosted runner for a repository
Remove all custom labels from a self-hosted runner configured in a repository. Returns the remaining read-only labels from the runner.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Параметры для "Remove all custom labels from a self-hosted runner for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. The name is not case sensitive. |
runner_id integer ОбязательноUnique identifier of the self-hosted runner. |
Коды состояния HTTP-ответа для "Remove all custom labels from a self-hosted runner for a repository"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
Примеры кода для "Remove all custom labels from a self-hosted runner for a repository"
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels
Response
Status: 200
{
"total_count": 3,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
}
]
}
Remove a custom label from a self-hosted runner for a repository
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.
You must authenticate using an access token with the repo
scope to use this
endpoint.
Параметры для "Remove a custom label from a self-hosted runner for a repository"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
owner string ОбязательноThe account owner of the repository. The name is not case sensitive. |
repo string ОбязательноThe name of the repository. 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's custom label. |
Коды состояния HTTP-ответа для "Remove a custom label from a self-hosted runner for a repository"
Код состояния | Описание |
---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed, or the endpoint has been spammed. |
Примеры кода для "Remove a custom label from a self-hosted runner for a repository"
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels/NAME
Response
Status: 200
{
"total_count": 4,
"labels": [
{
"id": 5,
"name": "self-hosted",
"type": "read-only"
},
{
"id": 7,
"name": "X64",
"type": "read-only"
},
{
"id": 20,
"name": "macOS",
"type": "read-only"
},
{
"id": 21,
"name": "no-gpu",
"type": "custom"
}
]
}