Skip to content

Add custom labels to a self-hosted runner for a repository

POST
/repos/{owner}/{repo}/actions/runners/{runner_id}/labels

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.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

runner_id
required
integer

Unique identifier of the self-hosted runner.

Media type application/json
object
labels
required

The names of the custom labels to add to the runner.

Array<string>
>= 1 items <= 100 items
Examples
Example default
{
"labels": [
"gpu",
"accelerated"
]
}

Response

Media type application/json
object
total_count
required
integer
labels
required
Array<object>
Self hosted runner label

A label for a self hosted runner

object
id

Unique identifier of the label.

integer
name
required

Name of the label.

string
type

The type of label. Read-only labels are applied automatically when the runner is configured.

string
Allowed values: read-only custom
Examples
Example default
{
"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"
}
]
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error Simple

Validation Error Simple

object
message
required
string
documentation_url
required
string
errors
Array<string>
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
"example"
]
}