Skip to content

Query all host runners under the specified repository

GET /api/v8/repos/{owner}/{repo}/actions/runners

Query all host runners under the specified repository, returning the runner total and the runner list.

Access token support

  • AtomGit user access tokens

Anonymous access

This endpoint does not allow anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Address path of the namespace that owns the repository (organization or personal address path)
repo path string Yes Repository path (path)
access_token query string Yes User authorization code
keyword query string No Keyword filter
page query integer No Current page number, default 1
per_page query integer No Number of items per page, default 10

Response parameters

Field Type Always returned Nullable Description
total_count integer Yes Yes Runner total
runners object[] Yes Yes Runner list

runners[] object

Field Type Always returned Nullable Description
runners[].id string Yes Yes Runner ID
runners[].runner_group_id string Yes Yes Runner Group ID
runners[].runner_name string Yes Yes Runner name
runners[].name string Yes Yes Name
runners[].work_dir string Yes Yes Working directory
runners[].labels object[] Yes Yes Label list
runners[].status string Yes Yes State; enum: IDLE / BUSY / OFFLINE / DISABLE
runners[].create_time integer Yes Yes Creation time
runners[].update_time integer Yes Yes Update time
runners[].memory number Yes Yes Memory usage (%)
runners[].disk number Yes Yes Available disk (GB)

runners[].labels[] object

Field Type Always returned Nullable Description
runners[].labels[].label_name string Yes Yes Label name
runners[].labels[].label_value string Yes Yes Label value
runners[].labels[].label_color string Yes Yes Label color

Request example

Parameter notes

<owner> is replaced with the address path of the namespace that owns the repository (organization or personal address path); <repo> is replaced with the repository path; <token> is replaced with your AtomGit user access token.

cURL

curl -X GET 'https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/runners?access_token=<token>&keyword=<keyword>&page=1&per_page=10' \
  -H 'Accept: application/json'

JavaScript

const response = await fetch(
  "https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/runners?access_token=<token>&page=1&per_page=10",
  {
    headers: {
      "Accept": "application/json",
    },
  }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v8/repos/<owner>/<repo>/actions/runners",
    params={
        "access_token": "<token>",
        "page": 1,
        "per_page": 10,
    },
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "total_count": 2,
  "runners": [
    {
      "id": "12345",
      "runner_group_id": "67890",
      "runner_name": "runner-01",
      "name": "runner-01",
      "work_dir": "/home/runner/work",
      "labels": [
        {
          "label_name": "self-hosted",
          "label_value": "true",
          "label_color": "0e8a16"
        },
        {
          "label_name": "Linux",
          "label_value": "X64",
          "label_color": "0052cc"
        }
      ],
      "status": "IDLE",
      "create_time": 1720000000,
      "update_time": 1720001000,
      "memory": 35.5,
      "disk": 120.0
    },
    {
      "id": "12346",
      "runner_group_id": "67890",
      "runner_name": "runner-02",
      "name": "runner-02",
      "work_dir": "/home/runner/work",
      "labels": [
        {
          "label_name": "self-hosted",
          "label_value": "true",
          "label_color": "0e8a16"
        },
        {
          "label_name": "Windows",
          "label_value": "X64",
          "label_color": "bf3989"
        }
      ],
      "status": "BUSY",
      "create_time": 1720000000,
      "update_time": 1720002000,
      "memory": 62.0,
      "disk": 200.0
    }
  ]
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access token)
400 Invalid parameters or the request could not be parsed
404 The request path does not exist
405 The request method is not supported
429 Too many requests; rate limit triggered
500 Internal server error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc