Use the REST API to interact with GitHub-hosted runners in GitHub Actions.
List GitHub-hosted runners for an enterprise Code samples for "List GitHub-hosted runners for an enterprise"If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/enterprises/{enterprise}/actions/hosted-runners
Copy to clipboard curl request example
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" } ] }
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.
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameters for "Create a GitHub-hosted runner for an enterprise" Headers Name, Type, Descriptionaccept
string
Setting to application/vnd.github+json
is recommended.
enterprise
string Required
The slug version of the enterprise name.
Body parameters Name, Type, Descriptionname
string Required
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 Required
The image of runner. To list all available images, use GET /actions/hosted-runners/images/github-owned
or GET /actions/hosted-runners/images/partner
.
image
Name, Type, Description
id
string
The unique identifier of the runner image.
source
string
The source of the runner image.
Can be one of: github
, partner
, custom
size
string Required
The machine size of the runner. To list available sizes, use GET actions/hosted-runners/machine-sizes
runner_group_id
integer Required
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.
Default: 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
Default: false
201
Created
Code samples for "Create a GitHub-hosted runner for an enterprise"If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
post/enterprises/{enterprise}/actions/hosted-runners
Copy to clipboard curl request example
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"},"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" }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/enterprises/{enterprise}/actions/hosted-runners/images/github-owned
Copy to clipboard curl request example
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" }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/enterprises/{enterprise}/actions/hosted-runners/images/partner
Copy to clipboard curl request example
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" }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/enterprises/{enterprise}/actions/hosted-runners/limits
Copy to clipboard curl request example
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 } }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/enterprises/{enterprise}/actions/hosted-runners/machine-sizes
Copy to clipboard curl request example
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 }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/enterprises/{enterprise}/actions/hosted-runners/platforms
Copy to clipboard curl request example
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" ] }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
Copy to clipboard curl request example
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" }
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.
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameters for "Update a GitHub-hosted runner for an enterprise" Headers Name, Type, Descriptionaccept
string
Setting to application/vnd.github+json
is recommended.
enterprise
string Required
The slug version of the enterprise name.
hosted_runner_id
integer Required
Unique identifier of the GitHub-hosted runner.
Body parameters Name, Type, Descriptionname
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
200
OK
Code samples for "Update a GitHub-hosted runner for an enterprise"If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
patch/enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
Copy to clipboard curl request example
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}'
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" }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
delete/enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}
Copy to clipboard curl request example
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" }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/orgs/{org}/actions/hosted-runners
Copy to clipboard curl request example
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" } ] }
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.
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
accept
string
Setting to application/vnd.github+json
is recommended.
org
string Required
The organization name. The name is not case sensitive.
Body parameters Name, Type, Descriptionname
string Required
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 Required
The image of runner. To list all available images, use GET /actions/hosted-runners/images/github-owned
or GET /actions/hosted-runners/images/partner
.
image
Name, Type, Description
id
string
The unique identifier of the runner image.
source
string
The source of the runner image.
Can be one of: github
, partner
, custom
size
string Required
The machine size of the runner. To list available sizes, use GET actions/hosted-runners/machine-sizes
runner_group_id
integer Required
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
201
Created
Code samples for "Create a GitHub-hosted runner for an organization"If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
post/orgs/{org}/actions/hosted-runners
Copy to clipboard curl request example
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"},"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" }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
get/orgs/{org}/actions/hosted-runners/{hosted_runner_id}
Copy to clipboard curl request example
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" }
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.
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
accept
string
Setting to application/vnd.github+json
is recommended.
org
string Required
The organization name. The name is not case sensitive.
hosted_runner_id
integer Required
Unique identifier of the GitHub-hosted runner.
Body parameters Name, Type, Descriptionname
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
200
OK
Code samples for "Update a GitHub-hosted runner for an organization"If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
patch/orgs/{org}/actions/hosted-runners/{hosted_runner_id}
Copy to clipboard curl request example
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}'
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" }
If you access GitHub at GHE.com, replace api.github.com
with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com
.
delete/orgs/{org}/actions/hosted-runners/{hosted_runner_id}
Copy to clipboard curl request example
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" }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4