Skip to main content
Wir veröffentlichen regelmäßig Aktualisierungen unserer Dokumentation, und die Übersetzung dieser Seite ist möglicherweise noch nicht abgeschlossen. Aktuelle Informationen findest du in der englischsprachigen Dokumentation.
GitHub AE ist derzeit begrenzt freigegeben.

Selbstgehostete Runner

Verwende die REST-API, um mit selbstgehosteten Runnern in GitHub Actions zu interagieren.

Informationen zu selbstgehosteten Runnern in GitHub Actions

Du kannst die REST-API verwenden, um selbstgehostete Runner in GitHub Actions zu registrieren, anzuzeigen und zu löschen. Dank selbstgehosteter Runner kannst du deine eigenen Runner hosten und die Umgebung anpassen, die für die Ausführung von Aufträgen in deinen GitHub Actions-Workflows verwendet wird. Weitere Informationen findest du unter Deinen eigenen Runner hosten.

Diese Endpunkte sind für authentifizierte Benutzer, OAuth Apps und GitHub Apps verfügbar. Zugriffstoken erfordern einen repo-Bereich für private Repositorys und einen public_repo-Bereich für interne Repositorys. GitHub Apps müssen über die administration-Berechtigung für Repositorys und organization_self_hosted_runners-Berechtigungen für Organisationen verfügen. Authentifizierte Benutzer müssen über Administratorzugriff auf Repositorys oder Organisationen oder auf den Bereich manage_runners:enterprise für Unternehmen verfügen, um diese Endpunkte zu verwenden.

List self-hosted runners for an enterprise

Lists all self-hosted runners configured for an enterprise.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Parameter für „List self-hosted runners for an enterprise“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100).

Standard: 30

page integer

Page number of the results to fetch.

Standard: 1

HTTP-Antwortstatuscodes für „List self-hosted runners for an enterprise“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „List self-hosted runners for an enterprise“

get/enterprises/{enterprise}/actions/runners
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/runners

Response

Status: 200
{ "total_count": 2, "runners": [ { "id": 23, "name": "linux_runner", "os": "linux", "status": "online", "busy": true, "labels": [ { "id": 5, "name": "self-hosted", "type": "read-only" }, { "id": 7, "name": "X64", "type": "read-only" }, { "id": 11, "name": "Linux", "type": "read-only" } ] }, { "id": 24, "name": "mac_runner", "os": "macos", "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" } ] } ] }

List runner applications for an enterprise

Lists binaries for the runner application that you can download and run.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Parameter für „List runner applications for an enterprise“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

HTTP-Antwortstatuscodes für „List runner applications for an enterprise“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „List runner applications for an enterprise“

get/enterprises/{enterprise}/actions/runners/downloads
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/runners/downloads

Response

Status: 200
[ { "os": "osx", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz", "filename": "actions-runner-osx-x64-2.164.0.tar.gz" }, { "os": "linux", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz", "filename": "actions-runner-linux-x64-2.164.0.tar.gz" }, { "os": "linux", "architecture": "arm", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz", "filename": "actions-runner-linux-arm-2.164.0.tar.gz" }, { "os": "win", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip", "filename": "actions-runner-win-x64-2.164.0.zip" }, { "os": "linux", "architecture": "arm64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz", "filename": "actions-runner-linux-arm64-2.164.0.tar.gz" } ]

Create a registration token for an enterprise

Returns a token that you can pass to the config script. The token expires after one hour.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Example using registration token

Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.

./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN

Parameter für „Create a registration token for an enterprise“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

HTTP-Antwortstatuscodes für „Create a registration token for an enterprise“

StatuscodeBESCHREIBUNG
201

Created

Codebeispiele für „Create a registration token for an enterprise“

post/enterprises/{enterprise}/actions/runners/registration-token
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/runners/registration-token

Response

Status: 201
{ "token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6", "expires_at": "2020-01-22T12:13:35.123-08:00" }

Create a remove token for an enterprise

Returns a token that you can pass to the config script to remove a self-hosted runner from an enterprise. The token expires after one hour.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Example using remove token

To remove your self-hosted runner from an enterprise, replace TOKEN with the remove token provided by this endpoint.

./config.sh remove --token TOKEN

Parameter für „Create a remove token for an enterprise“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

HTTP-Antwortstatuscodes für „Create a remove token for an enterprise“

StatuscodeBESCHREIBUNG
201

Created

Codebeispiele für „Create a remove token for an enterprise“

post/enterprises/{enterprise}/actions/runners/remove-token
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/runners/remove-token

Response

Status: 201
{ "token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6", "expires_at": "2020-01-29T12:13:35.123-08:00" }

Get a self-hosted runner for an enterprise

Gets a specific self-hosted runner configured in an enterprise.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Parameter für „Get a self-hosted runner for an enterprise“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

runner_id integer Erforderlich

Unique identifier of the self-hosted runner.

HTTP-Antwortstatuscodes für „Get a self-hosted runner for an enterprise“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „Get a self-hosted runner for an enterprise“

get/enterprises/{enterprise}/actions/runners/{runner_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/runners/RUNNER_ID

Response

Status: 200
{ "id": 23, "name": "MBP", "os": "macos", "status": "online", "busy": true, "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" } ] }

Delete a self-hosted runner from an enterprise

Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

You must authenticate using an access token with the admin:enterprise scope to use this endpoint.

Parameter für „Delete a self-hosted runner from an enterprise“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
enterprise string Erforderlich

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

runner_id integer Erforderlich

Unique identifier of the self-hosted runner.

HTTP-Antwortstatuscodes für „Delete a self-hosted runner from an enterprise“

StatuscodeBESCHREIBUNG
204

No Content

Codebeispiele für „Delete a self-hosted runner from an enterprise“

delete/enterprises/{enterprise}/actions/runners/{runner_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/enterprises/ENTERPRISE/actions/runners/RUNNER_ID

Response

Status: 204

List self-hosted runners for an organization

Funktioniert mit GitHub Apps

Lists all self-hosted runners configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Parameter für „List self-hosted runners for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100).

Standard: 30

page integer

Page number of the results to fetch.

Standard: 1

HTTP-Antwortstatuscodes für „List self-hosted runners for an organization“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „List self-hosted runners for an organization“

get/orgs/{org}/actions/runners
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/orgs/ORG/actions/runners

Response

Status: 200
{ "total_count": 2, "runners": [ { "id": 23, "name": "linux_runner", "os": "linux", "status": "online", "busy": true, "labels": [ { "id": 5, "name": "self-hosted", "type": "read-only" }, { "id": 7, "name": "X64", "type": "read-only" }, { "id": 11, "name": "Linux", "type": "read-only" } ] }, { "id": 24, "name": "mac_runner", "os": "macos", "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" } ] } ] }

List runner applications for an organization

Funktioniert mit GitHub Apps

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.

Parameter für „List runner applications for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

HTTP-Antwortstatuscodes für „List runner applications for an organization“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „List runner applications for an organization“

get/orgs/{org}/actions/runners/downloads
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/orgs/ORG/actions/runners/downloads

Response

Status: 200
[ { "os": "osx", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz", "filename": "actions-runner-osx-x64-2.164.0.tar.gz" }, { "os": "linux", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz", "filename": "actions-runner-linux-x64-2.164.0.tar.gz" }, { "os": "linux", "architecture": "arm", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz", "filename": "actions-runner-linux-arm-2.164.0.tar.gz" }, { "os": "win", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip", "filename": "actions-runner-win-x64-2.164.0.zip" }, { "os": "linux", "architecture": "arm64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz", "filename": "actions-runner-linux-arm64-2.164.0.tar.gz" } ]

Create a registration token for an organization

Funktioniert mit GitHub Apps

Returns a token that you can pass to the config script. The token expires after one hour.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Example using registration token

Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.

./config.sh --url https://github.com/octo-org --token TOKEN

Parameter für „Create a registration token for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

HTTP-Antwortstatuscodes für „Create a registration token for an organization“

StatuscodeBESCHREIBUNG
201

Created

Codebeispiele für „Create a registration token for an organization“

post/orgs/{org}/actions/runners/registration-token
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/orgs/ORG/actions/runners/registration-token

Response

Status: 201
{ "token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6", "expires_at": "2020-01-22T12:13:35.123-08:00" }

Create a remove token for an organization

Funktioniert mit GitHub Apps

Returns a token that you can pass to the config script to remove a self-hosted runner from an organization. The token expires after one hour.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Example using remove token

To remove your self-hosted runner from an organization, replace TOKEN with the remove token provided by this endpoint.

./config.sh remove --token TOKEN

Parameter für „Create a remove token for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

HTTP-Antwortstatuscodes für „Create a remove token for an organization“

StatuscodeBESCHREIBUNG
201

Created

Codebeispiele für „Create a remove token for an organization“

post/orgs/{org}/actions/runners/remove-token
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/orgs/ORG/actions/runners/remove-token

Response

Status: 201
{ "token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6", "expires_at": "2020-01-29T12:13:35.123-08:00" }

Get a self-hosted runner for an organization

Funktioniert mit GitHub Apps

Gets a specific self-hosted runner configured in an organization.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Parameter für „Get a self-hosted runner for an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

runner_id integer Erforderlich

Unique identifier of the self-hosted runner.

HTTP-Antwortstatuscodes für „Get a self-hosted runner for an organization“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „Get a self-hosted runner for an organization“

get/orgs/{org}/actions/runners/{runner_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/orgs/ORG/actions/runners/RUNNER_ID

Response

Status: 200
{ "id": 23, "name": "MBP", "os": "macos", "status": "online", "busy": true, "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" } ] }

Delete a self-hosted runner from an organization

Funktioniert mit GitHub Apps

Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

You must authenticate using an access token with the admin:org scope to use this endpoint.

Parameter für „Delete a self-hosted runner from an organization“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
org string Erforderlich

The organization name. The name is not case sensitive.

runner_id integer Erforderlich

Unique identifier of the self-hosted runner.

HTTP-Antwortstatuscodes für „Delete a self-hosted runner from an organization“

StatuscodeBESCHREIBUNG
204

No Content

Codebeispiele für „Delete a self-hosted runner from an organization“

delete/orgs/{org}/actions/runners/{runner_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/orgs/ORG/actions/runners/RUNNER_ID

Response

Status: 204

List self-hosted runners for a repository

Funktioniert mit GitHub Apps

Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the repo scope to use this endpoint.

Parameter für „List self-hosted runners for a repository“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
owner string Erforderlich

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

repo string Erforderlich

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

Abfrageparameter
Name, type, BESCHREIBUNG
per_page integer

The number of results per page (max 100).

Standard: 30

page integer

Page number of the results to fetch.

Standard: 1

HTTP-Antwortstatuscodes für „List self-hosted runners for a repository“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „List self-hosted runners for a repository“

get/repos/{owner}/{repo}/actions/runners
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/actions/runners

Response

Status: 200
{ "total_count": 2, "runners": [ { "id": 23, "name": "linux_runner", "os": "linux", "status": "online", "busy": true, "labels": [ { "id": 5, "name": "self-hosted", "type": "read-only" }, { "id": 7, "name": "X64", "type": "read-only" }, { "id": 11, "name": "Linux", "type": "read-only" } ] }, { "id": 24, "name": "mac_runner", "os": "macos", "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" } ] } ] }

List runner applications for a repository

Funktioniert mit GitHub Apps

Lists binaries for the runner application that you can download and run.

You must authenticate using an access token with the repo scope to use this endpoint.

Parameter für „List runner applications for a repository“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
owner string Erforderlich

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

repo string Erforderlich

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

HTTP-Antwortstatuscodes für „List runner applications for a repository“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „List runner applications for a repository“

get/repos/{owner}/{repo}/actions/runners/downloads
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/actions/runners/downloads

Response

Status: 200
[ { "os": "osx", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz", "filename": "actions-runner-osx-x64-2.164.0.tar.gz" }, { "os": "linux", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz", "filename": "actions-runner-linux-x64-2.164.0.tar.gz" }, { "os": "linux", "architecture": "arm", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz", "filename": "actions-runner-linux-arm-2.164.0.tar.gz" }, { "os": "win", "architecture": "x64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip", "filename": "actions-runner-win-x64-2.164.0.zip" }, { "os": "linux", "architecture": "arm64", "download_url": "https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz", "filename": "actions-runner-linux-arm64-2.164.0.tar.gz" } ]

Create a registration token for a repository

Funktioniert mit GitHub Apps

Returns a token that you can pass to the config script. The token expires after one hour. You must authenticate using an access token with the repo scope to use this endpoint.

Example using registration token

Configure your self-hosted runner, replacing TOKEN with the registration token provided by this endpoint.

./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN

Parameter für „Create a registration token for a repository“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
owner string Erforderlich

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

repo string Erforderlich

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

HTTP-Antwortstatuscodes für „Create a registration token for a repository“

StatuscodeBESCHREIBUNG
201

Created

Codebeispiele für „Create a registration token for a repository“

post/repos/{owner}/{repo}/actions/runners/registration-token
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/actions/runners/registration-token

Response

Status: 201
{ "token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6", "expires_at": "2020-01-22T12:13:35.123-08:00" }

Create a remove token for a repository

Funktioniert mit GitHub Apps

Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. You must authenticate using an access token with the repo scope to use this endpoint.

Example using remove token

To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.

./config.sh remove --token TOKEN

Parameter für „Create a remove token for a repository“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
owner string Erforderlich

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

repo string Erforderlich

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

HTTP-Antwortstatuscodes für „Create a remove token for a repository“

StatuscodeBESCHREIBUNG
201

Created

Codebeispiele für „Create a remove token for a repository“

post/repos/{owner}/{repo}/actions/runners/remove-token
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/actions/runners/remove-token

Response

Status: 201
{ "token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6", "expires_at": "2020-01-29T12:13:35.123-08:00" }

Get a self-hosted runner for a repository

Funktioniert mit GitHub Apps

Gets a specific self-hosted runner configured in a repository.

You must authenticate using an access token with the repo scope to use this endpoint.

Parameter für „Get a self-hosted runner for a repository“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
owner string Erforderlich

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

repo string Erforderlich

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

runner_id integer Erforderlich

Unique identifier of the self-hosted runner.

HTTP-Antwortstatuscodes für „Get a self-hosted runner for a repository“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „Get a self-hosted runner for a repository“

get/repos/{owner}/{repo}/actions/runners/{runner_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/actions/runners/RUNNER_ID

Response

Status: 200
{ "id": 23, "name": "MBP", "os": "macos", "status": "online", "busy": true, "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" } ] }

Delete a self-hosted runner from a repository

Funktioniert mit GitHub Apps

Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.

You must authenticate using an access token with the repo scope to use this endpoint.

Parameter für „Delete a self-hosted runner from a repository“

Header
Name, type, BESCHREIBUNG
accept string

Setting to application/vnd.github+json is recommended.

Pfadparameter
Name, type, BESCHREIBUNG
owner string Erforderlich

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

repo string Erforderlich

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

runner_id integer Erforderlich

Unique identifier of the self-hosted runner.

HTTP-Antwortstatuscodes für „Delete a self-hosted runner from a repository“

StatuscodeBESCHREIBUNG
204

No Content

Codebeispiele für „Delete a self-hosted runner from a repository“

delete/repos/{owner}/{repo}/actions/runners/{runner_id}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/repos/OWNER/REPO/actions/runners/RUNNER_ID

Response

Status: 204