Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

GitHub-hosted runners

Use the REST API to interact with GitHub-hosted runners in GitHub Actions.

List GitHub-hosted runners for an enterprise

Lists all GitHub-hosted runners configured in an enterprise.

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

Подробные маркеры доступа для "List GitHub-hosted runners for an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "List GitHub-hosted runners for an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Параметры запроса
Имя., Тип, Description
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

По умолчанию.: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

По умолчанию.: 1

Коды состояния http-ответа для "List GitHub-hosted runners for an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "List GitHub-hosted runners for an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/enterprises/{enterprise}/actions/hosted-runners
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/enterprises/ENTERPRISE/actions/hosted-runners

Response

Status: 200
{ "total_count": 2, "runners": [ { "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }, { "id": 7, "name": "My hosted Windows runner", "runner_group_id": 2, "platform": "win-x64", "image": { "id": "windows-latest", "size": 256 }, "machine_size_details": { "id": "8-core", "cpu_cores": 8, "memory_gb": 32, "storage_gb": 300 }, "status": "Ready", "maximum_runners": 20, "public_ip_enabled": false, "public_ips": [], "last_active_on": "2023-04-26T15:23:37Z" } ] }

Create a GitHub-hosted runner for an enterprise

Creates a GitHub-hosted runner for an enterprise. OAuth tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

Подробные маркеры доступа для "Create a GitHub-hosted runner for an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Create a GitHub-hosted runner for an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Параметры запроса
Имя., Тип, Description
name string Обязательное поле

Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'.

image object Обязательное поле

The image of runner. To list all available images, use GET /actions/hosted-runners/images/github-owned or GET /actions/hosted-runners/images/partner.

Имя., Тип, Description
id string

The unique identifier of the runner image.

source string

The source of the runner image.

Возможные значения: github, partner, custom

version string or null

The version of the runner image to deploy. This is relevant only for runners using custom images.

size string Обязательное поле

The machine size of the runner. To list available sizes, use GET actions/hosted-runners/machine-sizes

runner_group_id integer Обязательное поле

The existing runner group to add this runner to.

maximum_runners integer

The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost.

По умолчанию.: 50

enable_static_ip boolean

Whether this runner should be created with a static public IP. Note limit on account. To list limits on account, use GET actions/hosted-runners/limits

По умолчанию.: false

Коды состояния http-ответа для "Create a GitHub-hosted runner for an enterprise"

Код состоянияОписание
201

Created

Примеры кода для "Create a GitHub-hosted runner for an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

post/enterprises/{enterprise}/actions/hosted-runners
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/enterprises/ENTERPRISE/actions/hosted-runners \ -d '{"name":"My Hosted runner","image":{"id":"ubuntu-latest","source":"github","version":"latest"},"runner_group_id":1,"size":"4-core","maximum_runners":10}'

Response

Status: 201
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }

Get GitHub-owned images for GitHub-hosted runners in an enterprise

Get the list of GitHub-owned images available for GitHub-hosted runners for an enterprise.

Подробные маркеры доступа для "Get GitHub-owned images for GitHub-hosted runners in an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Get GitHub-owned images for GitHub-hosted runners in an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Коды состояния http-ответа для "Get GitHub-owned images for GitHub-hosted runners in an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "Get GitHub-owned images for GitHub-hosted runners in an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/enterprises/{enterprise}/actions/hosted-runners/images/github-owned
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/enterprises/ENTERPRISE/actions/hosted-runners/images/github-owned

Response

Status: 200
{ "id": "ubuntu-20.04", "platform": "linux-x64", "size_gb": 86, "display_name": "20.04", "source": "github" }

Get partner images for GitHub-hosted runners in an enterprise

Get the list of partner images available for GitHub-hosted runners for an enterprise.

Подробные маркеры доступа для "Get partner images for GitHub-hosted runners in an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Get partner images for GitHub-hosted runners in an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Коды состояния http-ответа для "Get partner images for GitHub-hosted runners in an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "Get partner images for GitHub-hosted runners in an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/enterprises/{enterprise}/actions/hosted-runners/images/partner
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/enterprises/ENTERPRISE/actions/hosted-runners/images/partner

Response

Status: 200
{ "id": "ubuntu-20.04", "platform": "linux-x64", "size_gb": 86, "display_name": "20.04", "source": "github" }

Get limits on GitHub-hosted runners for an enterprise

Get the GitHub-hosted runners limits for an enterprise.

Подробные маркеры доступа для "Get limits on GitHub-hosted runners for an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Get limits on GitHub-hosted runners for an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Коды состояния http-ответа для "Get limits on GitHub-hosted runners for an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "Get limits on GitHub-hosted runners for an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/enterprises/{enterprise}/actions/hosted-runners/limits
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/enterprises/ENTERPRISE/actions/hosted-runners/limits

Response

Status: 200
{ "public_ips": { "current_usage": 17, "maximum": 50 } }

Get GitHub-hosted runners machine specs for an enterprise

Get the list of machine specs available for GitHub-hosted runners for an enterprise.

Подробные маркеры доступа для "Get GitHub-hosted runners machine specs for an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Get GitHub-hosted runners machine specs for an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Коды состояния http-ответа для "Get GitHub-hosted runners machine specs for an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "Get GitHub-hosted runners machine specs for an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/enterprises/{enterprise}/actions/hosted-runners/machine-sizes
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/enterprises/ENTERPRISE/actions/hosted-runners/machine-sizes

Response

Status: 200
{ "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }

Get platforms for GitHub-hosted runners in an enterprise

Get the list of platforms available for GitHub-hosted runners for an enterprise.

Подробные маркеры доступа для "Get platforms for GitHub-hosted runners in an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Get platforms for GitHub-hosted runners in an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Коды состояния http-ответа для "Get platforms for GitHub-hosted runners in an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "Get platforms for GitHub-hosted runners in an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/enterprises/{enterprise}/actions/hosted-runners/platforms
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/enterprises/ENTERPRISE/actions/hosted-runners/platforms

Response

Status: 200
{ "total_count": 1, "platforms": [ "linux-x64", "win-x64" ] }

Get a GitHub-hosted runner for an enterprise

Gets a GitHub-hosted runner configured in an enterprise.

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

Подробные маркеры доступа для "Get a GitHub-hosted runner for an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Get a GitHub-hosted runner for an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

hosted_runner_id integer Обязательное поле

Unique identifier of the GitHub-hosted runner.

Коды состояния http-ответа для "Get a GitHub-hosted runner for an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "Get a GitHub-hosted runner for an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
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/enterprises/ENTERPRISE/actions/hosted-runners/HOSTED_RUNNER_ID

Response

Status: 200
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }

Update a GitHub-hosted runner for an enterprise

Updates a GitHub-hosted runner for an enterprise. OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

Подробные маркеры доступа для "Update a GitHub-hosted runner for an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Update a GitHub-hosted runner for an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

hosted_runner_id integer Обязательное поле

Unique identifier of the GitHub-hosted runner.

Параметры запроса
Имя., Тип, Description
name string

Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'.

runner_group_id integer

The existing runner group to add this runner to.

maximum_runners integer

The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost.

enable_static_ip boolean

Whether this runner should be updated with a static public IP. Note limit on account. To list limits on account, use GET actions/hosted-runners/limits

image_version string or null

The version of the runner image to deploy. This is relevant only for runners using custom images.

Коды состояния http-ответа для "Update a GitHub-hosted runner for an enterprise"

Код состоянияОписание
200

OK

Примеры кода для "Update a GitHub-hosted runner for an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

patch/enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/enterprises/ENTERPRISE/actions/hosted-runners/HOSTED_RUNNER_ID \ -d '{"name":"My Hosted runner","runner_group_id":1,"maximum_runners":50,"enable_static_ip":false,"image_version":"1.0.0"}'

Response

Status: 200
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }

Delete a GitHub-hosted runner for an enterprise

Deletes a GitHub-hosted runner for an enterprise.

Подробные маркеры доступа для "Delete a GitHub-hosted runner for an enterprise

Эта конечная точка не работает с маркерами доступа пользователей приложения GitHub, маркерами доступа к установке приложения GitHub или точными личными маркерами доступа.

Параметры для "Delete a GitHub-hosted runner for an enterprise"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
enterprise string Обязательное поле

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

hosted_runner_id integer Обязательное поле

Unique identifier of the GitHub-hosted runner.

Коды состояния http-ответа для "Delete a GitHub-hosted runner for an enterprise"

Код состоянияОписание
202

Accepted

Примеры кода для "Delete a GitHub-hosted runner for an enterprise"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

delete/enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
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/enterprises/ENTERPRISE/actions/hosted-runners/HOSTED_RUNNER_ID

Response

Status: 202
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }

List GitHub-hosted runners for an organization

Lists all GitHub-hosted runners configured in an organization.

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

Подробные маркеры доступа для "List GitHub-hosted runners for an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (read)

Параметры для "List GitHub-hosted runners for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

По умолчанию.: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

По умолчанию.: 1

Коды состояния http-ответа для "List GitHub-hosted runners for an organization"

Код состоянияОписание
200

OK

Примеры кода для "List GitHub-hosted runners for an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/orgs/{org}/actions/hosted-runners
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/hosted-runners

Response

Status: 200
{ "total_count": 2, "runners": [ { "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }, { "id": 7, "name": "My hosted Windows runner", "runner_group_id": 2, "platform": "win-x64", "image": { "id": "windows-latest", "size": 256 }, "machine_size_details": { "id": "8-core", "cpu_cores": 8, "memory_gb": 32, "storage_gb": 300 }, "status": "Ready", "maximum_runners": 20, "public_ip_enabled": false, "public_ips": [], "last_active_on": "2023-04-26T15:23:37Z" } ] }

Create a GitHub-hosted runner for an organization

Creates a GitHub-hosted runner for an organization. OAuth tokens and personal access tokens (classic) need the manage_runners:org scope to use this endpoint.

Подробные маркеры доступа для "Create a GitHub-hosted runner for an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (write)

Параметры для "Create a GitHub-hosted runner for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
name string Обязательное поле

Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'.

image object Обязательное поле

The image of runner. To list all available images, use GET /actions/hosted-runners/images/github-owned or GET /actions/hosted-runners/images/partner.

Имя., Тип, Description
id string

The unique identifier of the runner image.

source string

The source of the runner image.

Возможные значения: github, partner, custom

version string or null

The version of the runner image to deploy. This is relevant only for runners using custom images.

size string Обязательное поле

The machine size of the runner. To list available sizes, use GET actions/hosted-runners/machine-sizes

runner_group_id integer Обязательное поле

The existing runner group to add this runner to.

maximum_runners integer

The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost.

enable_static_ip boolean

Whether this runner should be created with a static public IP. Note limit on account. To list limits on account, use GET actions/hosted-runners/limits

Коды состояния http-ответа для "Create a GitHub-hosted runner for an organization"

Код состоянияОписание
201

Created

Примеры кода для "Create a GitHub-hosted runner for an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

post/orgs/{org}/actions/hosted-runners
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/hosted-runners \ -d '{"name":"My Hosted runner","image":{"id":"ubuntu-latest","source":"github","version":"latest"},"runner_group_id":1,"size":"4-core","maximum_runners":50,"enable_static_ip":false}'

Response

Status: 201
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }

Get GitHub-owned images for GitHub-hosted runners in an organization

Get the list of GitHub-owned images available for GitHub-hosted runners for an organization.

Подробные маркеры доступа для "Get GitHub-owned images for GitHub-hosted runners in an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (read)

Параметры для "Get GitHub-owned images for GitHub-hosted runners in an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Get GitHub-owned images for GitHub-hosted runners in an organization"

Код состоянияОписание
200

OK

Примеры кода для "Get GitHub-owned images for GitHub-hosted runners in an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/orgs/{org}/actions/hosted-runners/images/github-owned
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/hosted-runners/images/github-owned

Response

Status: 200
{ "id": "ubuntu-20.04", "platform": "linux-x64", "size_gb": 86, "display_name": "20.04", "source": "github" }

Get partner images for GitHub-hosted runners in an organization

Get the list of partner images available for GitHub-hosted runners for an organization.

Подробные маркеры доступа для "Get partner images for GitHub-hosted runners in an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (read)

Параметры для "Get partner images for GitHub-hosted runners in an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Get partner images for GitHub-hosted runners in an organization"

Код состоянияОписание
200

OK

Примеры кода для "Get partner images for GitHub-hosted runners in an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/orgs/{org}/actions/hosted-runners/images/partner
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/hosted-runners/images/partner

Response

Status: 200
{ "id": "ubuntu-20.04", "platform": "linux-x64", "size_gb": 86, "display_name": "20.04", "source": "github" }

Get limits on GitHub-hosted runners for an organization

Get the GitHub-hosted runners limits for an organization.

Подробные маркеры доступа для "Get limits on GitHub-hosted runners for an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (read)

Параметры для "Get limits on GitHub-hosted runners for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Get limits on GitHub-hosted runners for an organization"

Код состоянияОписание
200

OK

Примеры кода для "Get limits on GitHub-hosted runners for an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/orgs/{org}/actions/hosted-runners/limits
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/hosted-runners/limits

Response

Status: 200
{ "public_ips": { "current_usage": 17, "maximum": 50 } }

Get GitHub-hosted runners machine specs for an organization

Get the list of machine specs available for GitHub-hosted runners for an organization.

Подробные маркеры доступа для "Get GitHub-hosted runners machine specs for an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (read)

Параметры для "Get GitHub-hosted runners machine specs for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Get GitHub-hosted runners machine specs for an organization"

Код состоянияОписание
200

OK

Примеры кода для "Get GitHub-hosted runners machine specs for an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/orgs/{org}/actions/hosted-runners/machine-sizes
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/hosted-runners/machine-sizes

Response

Status: 200
{ "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }

Get platforms for GitHub-hosted runners in an organization

Get the list of platforms available for GitHub-hosted runners for an organization.

Подробные маркеры доступа для "Get platforms for GitHub-hosted runners in an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (read)

Параметры для "Get platforms for GitHub-hosted runners in an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Get platforms for GitHub-hosted runners in an organization"

Код состоянияОписание
200

OK

Примеры кода для "Get platforms for GitHub-hosted runners in an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/orgs/{org}/actions/hosted-runners/platforms
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/hosted-runners/platforms

Response

Status: 200
{ "total_count": 1, "platforms": [ "linux-x64", "win-x64" ] }

Get a GitHub-hosted runner for an organization

Gets a GitHub-hosted runner configured in an organization.

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

Подробные маркеры доступа для "Get a GitHub-hosted runner for an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (read)

Параметры для "Get a GitHub-hosted runner for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

hosted_runner_id integer Обязательное поле

Unique identifier of the GitHub-hosted runner.

Коды состояния http-ответа для "Get a GitHub-hosted runner for an organization"

Код состоянияОписание
200

OK

Примеры кода для "Get a GitHub-hosted runner for an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

get/orgs/{org}/actions/hosted-runners/{hosted_runner_id}
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/hosted-runners/HOSTED_RUNNER_ID

Response

Status: 200
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }

Update a GitHub-hosted runner for an organization

Updates a GitHub-hosted runner for an organization. OAuth app tokens and personal access tokens (classic) need the manage_runners:org scope to use this endpoint.

Подробные маркеры доступа для "Update a GitHub-hosted runner for an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (write)

Параметры для "Update a GitHub-hosted runner for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

hosted_runner_id integer Обязательное поле

Unique identifier of the GitHub-hosted runner.

Параметры запроса
Имя., Тип, Description
name string

Name of the runner. Must be between 1 and 64 characters and may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'.

runner_group_id integer

The existing runner group to add this runner to.

maximum_runners integer

The maximum amount of runners to scale up to. Runners will not auto-scale above this number. Use this setting to limit your cost.

enable_static_ip boolean

Whether this runner should be updated with a static public IP. Note limit on account. To list limits on account, use GET actions/hosted-runners/limits

image_version string or null

The version of the runner image to deploy. This is relevant only for runners using custom images.

Коды состояния http-ответа для "Update a GitHub-hosted runner for an organization"

Код состоянияОписание
200

OK

Примеры кода для "Update a GitHub-hosted runner for an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

patch/orgs/{org}/actions/hosted-runners/{hosted_runner_id}
curl -L \ -X PATCH \ -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/hosted-runners/HOSTED_RUNNER_ID \ -d '{"name":"My larger runner","runner_group_id":1,"maximum_runners":50,"enable_static_ip":false,"image_version":"1.0.0"}'

Response

Status: 200
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }

Delete a GitHub-hosted runner for an organization

Deletes a GitHub-hosted runner for an organization.

Подробные маркеры доступа для "Delete a GitHub-hosted runner for an organization

Эта конечная точка работает со следующими точными типами маркеров:

Маркер с точной детализацией должен иметь следующий набор разрешений.:

  • "Administration" organization permissions (write)

Параметры для "Delete a GitHub-hosted runner for an organization"

Заголовки
Имя., Тип, Description
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

hosted_runner_id integer Обязательное поле

Unique identifier of the GitHub-hosted runner.

Коды состояния http-ответа для "Delete a GitHub-hosted runner for an organization"

Код состоянияОписание
202

Accepted

Примеры кода для "Delete a GitHub-hosted runner for an organization"

Если вы обращаетесь к GitHub в GHE.com, замените api.github.com выделенный поддомен api.SUBDOMAIN.ghe.comпредприятия.

Пример запроса

delete/orgs/{org}/actions/hosted-runners/{hosted_runner_id}
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/hosted-runners/HOSTED_RUNNER_ID

Response

Status: 202
{ "id": 5, "name": "My hosted ubuntu runner", "runner_group_id": 2, "platform": "linux-x64", "image": { "id": "ubuntu-20.04", "size": 86 }, "machine_size_details": { "id": "4-core", "cpu_cores": 4, "memory_gb": 16, "storage_gb": 150 }, "status": "Ready", "maximum_runners": 10, "public_ip_enabled": true, "public_ips": [ { "enabled": true, "prefix": "20.80.208.150", "length": 31 } ], "last_active_on": "2022-10-09T23:39:01Z" }