Skip to content

Create configuration for a just-in-time runner for a repository

POST
/repos/{owner}/{repo}/actions/runners/generate-jitconfig

Generates a configuration that can be passed to the runner application at startup.

The authenticated user must have admin access to the repository.

OAuth tokens and personal access tokens (classic) need therepo 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.

Media type application/json
object
name
required

The name of the new runner.

string
runner_group_id
required

The ID of the runner group to register the runner to.

integer
labels
required

The names of the custom labels to add to the runner. Minimum items: 1. Maximum items: 100.

Array<string>
>= 1 items <= 100 items
work_folder

The working directory to be used for job execution, relative to the runner install directory.

string
default: _work
Examples
Example default
{
"name": "New runner",
"runner_group_id": 1,
"labels": [
"self-hosted",
"X64",
"macOS",
"no-gpu"
],
"work_folder": "_work"
}

Response

Media type application/json
object
runner
required
Self hosted runners

A self hosted runner

object
id
required

The ID of the runner.

integer
runner_group_id

The ID of the runner group.

integer
name
required

The name of the runner.

string
os
required

The Operating System of the runner.

string
status
required

The status of the runner.

string
busy
required
boolean
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
ephemeral
boolean
version

The version of the GitHub Actions Runner software. This is only set if the runner has connected to the service at least once.

string
nullable
encoded_jit_config
required

The base64 encoded runner configuration.

string
Examples
Example default
{
"runner": {
"id": 23,
"name": "New runner",
"os": "unknown",
"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"
}
]
},
"encoded_jit_config": "abc123"
}

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"
}

Conflict

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"
]
}