0

List runner applications for an organization

by
Published Oct 25, 2023

Lists binaries for the runner application that you can download and run. You must authenticate using an access token with the `admin:org` scope to use this endpoint.

Script github Verified

The script

Submitted by hugo697 Typescript (fetch-only)
Verified 398 days ago
1
type Github = {
2
  token: string;
3
};
4
/**
5
 * List runner applications for an organization
6
 * Lists binaries for the runner application that you can download and run.
7

8
You must authenticate using an access token with the `admin:org` scope to use this endpoint.
9
 */
10
export async function main(auth: Github, org: string) {
11
  const url = new URL(
12
    `https://api.github.com/orgs/${org}/actions/runners/downloads`
13
  );
14

15
  const response = await fetch(url, {
16
    method: "GET",
17
    headers: {
18
      Authorization: "Bearer " + auth.token,
19
    },
20
    body: undefined,
21
  });
22
  if (!response.ok) {
23
    const text = await response.text();
24
    throw new Error(`${response.status} ${text}`);
25
  }
26
  return await response.json();
27
}
28