Skip to content

Change where g1t agent work runs and whether pull requests from forks may use self-hosted runners, for a workspace or one repository.

PATCH/repos/{owner}/{name}/actions/runner-settings

Left out is unchanged; inherit drops a repository’s own settings. Allowing forks lets anyone who can open a pull request run code on your machines. Owners of the workspace, or admins of the repository.

Name Type Required Description
owner string Yes The workspace that owns the repository.
name string Yes The repository’s name.

Send a JSON object. Names are snake_case, as in responses; the camelCase spelling is accepted too.

Name Type Required Description
agents_on_self_hosted boolean No Run agent runs, checks, reviews and the merge queue on self-hosted runners.
agent_labels array of strings No The labels a runner needs to take agent work. self-hosted is always one.
fork_pull_requests boolean No Let jobs of pull requests from forks run on self-hosted runners.
inherit boolean No For a repository: drop its own settings and follow its workspace’s.
workspace string No Instead of repo: the workspace, for the runners its repositories share.
curl -X PATCH https://api.g1t.sh/repos/flagon-io/hello/actions/runner-settings \
-H "Authorization: Bearer $G1T_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inherit": true
}'

A successful request answers 200 with:

{
"agents_on_self_hosted": false,
"agent_labels": [
"self-hosted",
"linux"
],
"fork_pull_requests": false,
"inherited": true
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
409 conflict The request conflicts with the current state.
422 invalid The input is not valid. message says which field and why.