GitHub Enterprise administration

Neste artigo

You can use these endpoints to administer your enterprise. Among the tasks you can perform with this API are many relating to GitHub Actions.

Note: This article applies to GitHub Enterprise Cloud. To see the GitHub AE or GitHub Enterprise Server version, use the Versão do artigo drop-down menu.

Endpoint URLs

REST API endpoints are prefixed with the following URL:

https://api.github.com

Audit log

Get the audit log for an enterprise

Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the admin:enterprise scope.

get /enterprises/{enterprise}/audit-log

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

phrase string query

A search phrase. For more information, see Searching the audit log.

include string query

The event types to include:

  • web - returns web (non-Git) events.
  • git - returns Git events.
  • all - returns both web and Git events.

The default is web.

after string query

A cursor, as given in the Link header. If specified, the query only searches for events after this cursor.

before string query

A cursor, as given in the Link header. If specified, the query only searches for events before this cursor.

order string query

The order of audit log events. To list newest events first, specify desc. To list oldest events first, specify asc.

The default is desc.

page integer query

Page number of the results to fetch.

Default: 1
per_page integer query

Results per page (max 100)

Default: 30

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/audit-log
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/audit-log', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
[
  {
    "@timestamp": 1606929874512,
    "action": "team.add_member",
    "actor": "octocat",
    "created_at": 1606929874512,
    "_document_id": "xJJFlFOhQ6b-5vaAFy9Rjw",
    "org": "octo-corp",
    "team": "octo-corp/example-team",
    "user": "monalisa"
  },
  {
    "@timestamp": 1606507117008,
    "action": "org.create",
    "actor": "octocat",
    "created_at": 1606507117008,
    "_document_id": "Vqvg6kZ4MYqwWRKFDzlMoQ",
    "org": "octocat-test-org"
  },
  {
    "@timestamp": 1605719148837,
    "action": "repo.destroy",
    "actor": "monalisa",
    "created_at": 1605719148837,
    "_document_id": "LwW2vpJZCDS-WUmo9Z-ifw",
    "org": "mona-org",
    "repo": "mona-org/mona-test-repo",
    "visibility": "private"
  }
]

Billing

Get GitHub Actions billing for an enterprise

Gets the summary of the free and paid GitHub Actions minutes used.

Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions".

The authenticated user must be an enterprise admin.

get /enterprises/{enterprise}/settings/billing/actions

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/settings/billing/actions
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/settings/billing/actions', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "total_minutes_used": 305,
  "total_paid_minutes_used": 0,
  "included_minutes": 3000,
  "minutes_used_breakdown": {
    "UBUNTU": 205,
    "MACOS": 10,
    "WINDOWS": 90
  }
}

Get GitHub Advanced Security active committers for an enterprise

Gets the GitHub Advanced Security active committers for an enterprise per repository. Each distinct user login across all repositories is counted as a single Advanced Security seat, so the total_advanced_security_committers is not the sum of active_users for each repository.

get /enterprises/{enterprise}/settings/billing/advanced-security

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/settings/billing/advanced-security
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/settings/billing/advanced-security', {
  enterprise: 'enterprise'
})

Success

Status: 200 OK
{
  "total_advanced_security_committers": 2,
  "repositories": [
    {
      "name": "octocat-org/Hello-World",
      "advanced_security_committers": 2,
      "advanced_security_committers_breakdown": [
        {
          "user_login": "octocat",
          "last_pushed_date": "2021-11-03"
        },
        {
          "user_login": "octokitten",
          "last_pushed_date": "2021-10-25"
        }
      ]
    },
    {
      "name": "octocat-org/server",
      "advanced_security_committers": 1,
      "advanced_security_committers_breakdown": [
        {
          "user_login": "octokitten",
          "last_pushed_date": "2021-10-26"
        }
      ]
    }
  ]
}

Response if GitHub Advanced Security is not enabled for this repository

Status: 403 Forbidden

Notes


Get GitHub Packages billing for an enterprise

Gets the free and paid storage used for GitHub Packages in gigabytes.

Paid minutes only apply to packages stored for private repositories. For more information, see "Managing billing for GitHub Packages."

The authenticated user must be an enterprise admin.

get /enterprises/{enterprise}/settings/billing/packages

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/settings/billing/packages
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/settings/billing/packages', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "total_gigabytes_bandwidth_used": 50,
  "total_paid_gigabytes_bandwidth_used": 40,
  "included_gigabytes_bandwidth": 10
}

Get shared storage billing for an enterprise

Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages.

Paid minutes only apply to packages stored for private repositories. For more information, see "Managing billing for GitHub Packages."

The authenticated user must be an enterprise admin.

get /enterprises/{enterprise}/settings/billing/shared-storage

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/settings/billing/shared-storage
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/settings/billing/shared-storage', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "days_left_in_billing_cycle": 20,
  "estimated_paid_storage_for_month": 15,
  "estimated_storage_for_month": 40
}

GitHub Actions

Get GitHub Actions permissions for an enterprise

Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.

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

get /enterprises/{enterprise}/actions/permissions

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/permissions', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "enabled_organizations": "all",
  "allowed_actions": "selected",
  "selected_actions_url": "https://api.github.com/enterprises/2/actions/permissions/selected-actions"
}

Set GitHub Actions permissions for an enterprise

Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.

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

put /enterprises/{enterprise}/actions/permissions

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

enabled_organizations string body

Required. The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: all, none, or selected.

allowed_actions string body

The permissions policy that controls the actions that are allowed to run. Can be one of: all, local_only, or selected.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions \
  -d '{"enabled_organizations":"enabled_organizations"}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/permissions', {
  enterprise: 'enterprise',
  enabled_organizations: 'enabled_organizations'
})

Response

Status: 204 No Content

List selected organizations enabled for GitHub Actions in an enterprise

Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."

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

get /enterprises/{enterprise}/actions/permissions/organizations

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/permissions/organizations', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "total_count": 1,
  "organizations": [
    {
      "login": "octocat",
      "id": 161335,
      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
      "url": "https://api.github.com/orgs/octo-org",
      "repos_url": "https://api.github.com/orgs/octo-org/repos",
      "events_url": "https://api.github.com/orgs/octo-org/events",
      "hooks_url": "https://api.github.com/orgs/octo-org/hooks",
      "issues_url": "https://api.github.com/orgs/octo-org/issues",
      "members_url": "https://api.github.com/orgs/octo-org/members{/member}",
      "public_members_url": "https://api.github.com/orgs/octo-org/public_members{/member}",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "description": "A great organization"
    }
  ]
}

Set selected organizations enabled for GitHub Actions in an enterprise

Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."

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

put /enterprises/{enterprise}/actions/permissions/organizations

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

selected_organization_ids array of integers body

Required. List of organization IDs to enable for GitHub Actions.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations \
  -d '{"selected_organization_ids":[42]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/permissions/organizations', {
  enterprise: 'enterprise',
  selected_organization_ids: [
    42
  ]
})

Response

Status: 204 No Content

Enable a selected organization for GitHub Actions in an enterprise

Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."

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

put /enterprises/{enterprise}/actions/permissions/organizations/{org_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

org_id integer path

Unique identifier of an organization.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations/42
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}', {
  enterprise: 'enterprise',
  org_id: 42
})

Response

Status: 204 No Content

Disable a selected organization for GitHub Actions in an enterprise

Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."

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

delete /enterprises/{enterprise}/actions/permissions/organizations/{org_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

org_id integer path

Unique identifier of an organization.

Amostras de código

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}', {
  enterprise: 'enterprise',
  org_id: 42
})

Response

Status: 204 No Content

Get allowed actions for an enterprise

Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."

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

get /enterprises/{enterprise}/actions/permissions/selected-actions

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions/selected-actions
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/permissions/selected-actions', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "github_owned_allowed": true,
  "verified_allowed": false,
  "patterns_allowed": [
    "monalisa/octocat@*",
    "docker/*"
  ]
}

Set allowed actions for an enterprise

Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an enterprise."

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

put /enterprises/{enterprise}/actions/permissions/selected-actions

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

github_owned_allowed boolean body

Whether GitHub-owned actions are allowed. For example, this includes the actions in the actions organization.

verified_allowed boolean body

Whether actions in GitHub Marketplace from verified creators are allowed. Set to true to allow all GitHub Marketplace actions by verified creators.

patterns_allowed array of strings body

Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, monalisa/octocat@*, monalisa/octocat@v2, monalisa/*."

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/permissions/selected-actions \
  -d '{"github_owned_allowed":true}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/permissions/selected-actions', {
  enterprise: 'enterprise',
  github_owned_allowed: true
})

Response

Status: 204 No Content

List self-hosted runner groups for an enterprise

Lists all self-hosted runner groups for an enterprise.

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

get /enterprises/{enterprise}/actions/runner-groups

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runner-groups', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "total_count": 3,
  "runner_groups": [
    {
      "id": 1,
      "name": "Default",
      "visibility": "all",
      "default": true,
      "runners_url": "https://api.github.com/enterprises/octo-corp/actions/runner_groups/1/runners",
      "allows_public_repositories": false
    },
    {
      "id": 2,
      "name": "octo-runner-group",
      "visibility": "selected",
      "default": false,
      "selected_organizations_url": "https://api.github.com/enterprises/octo-corp/actions/runner_groups/2/organizations",
      "runners_url": "https://api.github.com/enterprises/octo-corp/actions/runner_groups/2/runners",
      "allows_public_repositories": true
    },
    {
      "id": 3,
      "name": "expensive-hardware",
      "visibility": "private",
      "default": false,
      "runners_url": "https://api.github.com/enterprises/octo-corp/actions/runner_groups/3/runners",
      "allows_public_repositories": true
    }
  ]
}

Create a self-hosted runner group for an enterprise

Creates a new self-hosted runner group for an enterprise.

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

post /enterprises/{enterprise}/actions/runner-groups

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

name string body

Required. Name of the runner group.

visibility string body

Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: all or selected

selected_organization_ids array of integers body

List of organization IDs that can access the runner group.

runners array of integers body

List of runner IDs to add to the runner group.

allows_public_repositories boolean body

Whether the runner group can be used by public repositories.

Default: false

Amostras de código

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups \
  -d '{"name":"name"}'
JavaScript (@octokit/core.js)
await octokit.request('POST /enterprises/{enterprise}/actions/runner-groups', {
  enterprise: 'enterprise',
  name: 'name'
})

Response

Status: 201 Created
{
  "id": 2,
  "name": "octo-runner-group",
  "visibility": "selected",
  "default": false,
  "selected_organizations_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations",
  "runners_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners",
  "allows_public_repositories": false
}

Get a self-hosted runner group for an enterprise

Gets a specific self-hosted runner group for an enterprise.

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

get /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}', {
  enterprise: 'enterprise',
  runner_group_id: 42
})

Response

Status: 200 OK
{
  "id": 2,
  "name": "octo-runner-group",
  "visibility": "selected",
  "default": false,
  "selected_organizations_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations",
  "runners_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners",
  "allows_public_repositories": false
}

Update a self-hosted runner group for an enterprise

Updates the name and visibility of a self-hosted runner group in an enterprise.

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

patch /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

name string body

Name of the runner group.

visibility string body

Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: all or selected

Default: all
allows_public_repositories boolean body

Whether the runner group can be used by public repositories.

Default: false

Amostras de código

Shell
curl \
  -X PATCH \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42 \
  -d '{"name":"name"}'
JavaScript (@octokit/core.js)
await octokit.request('PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}', {
  enterprise: 'enterprise',
  runner_group_id: 42,
  name: 'name'
})

Response

Status: 200 OK
{
  "id": 2,
  "name": "Expensive hardware runners",
  "visibility": "selected",
  "default": false,
  "selected_organizations_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/organizations",
  "runners_url": "https://api.github.com/enterprises/octo-corp/actions/runner-groups/2/runners",
  "allows_public_repositories": true
}

Delete a self-hosted runner group from an enterprise

Deletes a self-hosted runner group for an enterprise.

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

delete /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

Amostras de código

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}', {
  enterprise: 'enterprise',
  runner_group_id: 42
})

Response

Status: 204 No Content

List organization access to a self-hosted runner group in an enterprise

Lists the organizations with access to a self-hosted runner group.

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

get /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/organizations
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations', {
  enterprise: 'enterprise',
  runner_group_id: 42
})

Response

Status: 200 OK
{
  "total_count": 1,
  "organizations": [
    {
      "login": "octocat",
      "id": 161335,
      "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
      "url": "https://api.github.com/orgs/octo-org",
      "repos_url": "https://api.github.com/orgs/octo-org/repos",
      "events_url": "https://api.github.com/orgs/octo-org/events",
      "hooks_url": "https://api.github.com/orgs/octo-org/hooks",
      "issues_url": "https://api.github.com/orgs/octo-org/issues",
      "members_url": "https://api.github.com/orgs/octo-org/members{/member}",
      "public_members_url": "https://api.github.com/orgs/octo-org/public_members{/member}",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "description": "A great organization"
    }
  ]
}

Set organization access for a self-hosted runner group in an enterprise

Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise.

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

put /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

selected_organization_ids array of integers body

Required. List of organization IDs that can access the runner group.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/organizations \
  -d '{"selected_organization_ids":[42]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations', {
  enterprise: 'enterprise',
  runner_group_id: 42,
  selected_organization_ids: [
    42
  ]
})

Response

Status: 204 No Content

Add organization access to a self-hosted runner group in an enterprise

Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see "Create a self-hosted runner group for an enterprise."

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

put /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

org_id integer path

Unique identifier of an organization.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/organizations/42
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}', {
  enterprise: 'enterprise',
  runner_group_id: 42,
  org_id: 42
})

Response

Status: 204 No Content

Remove organization access to a self-hosted runner group in an enterprise

Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see "Create a self-hosted runner group for an enterprise."

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

delete /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

org_id integer path

Unique identifier of an organization.

Amostras de código

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/organizations/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}', {
  enterprise: 'enterprise',
  runner_group_id: 42,
  org_id: 42
})

Response

Status: 204 No Content

List self-hosted runners in a group for an enterprise

Lists the self-hosted runners that are in a specific enterprise group.

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

get /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/runners
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners', {
  enterprise: 'enterprise',
  runner_group_id: 42
})

Response

Status: 200 OK
{
  "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"
        }
      ]
    }
  ]
}

Set self-hosted runners in a group for an enterprise

Replaces the list of self-hosted runners that are part of an enterprise runner group.

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

put /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

runners array of integers body

Required. List of runner IDs to add to the runner group.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/runners \
  -d '{"runners":[42]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners', {
  enterprise: 'enterprise',
  runner_group_id: 42,
  runners: [
    42
  ]
})

Response

Status: 204 No Content

Add a self-hosted runner to a group for an enterprise

Adds a self-hosted runner to a runner group configured in an enterprise.

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

put /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

runner_id integer path

Unique identifier of the self-hosted runner.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/runners/42
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
  enterprise: 'enterprise',
  runner_group_id: 42,
  runner_id: 42
})

Response

Status: 204 No Content

Remove a self-hosted runner from a group for an enterprise

Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.

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

delete /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_group_id integer path

Unique identifier of the self-hosted runner group.

runner_id integer path

Unique identifier of the self-hosted runner.

Amostras de código

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/42/runners/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
  enterprise: 'enterprise',
  runner_group_id: 42,
  runner_id: 42
})

Response

Status: 204 No Content

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 manage_runners:enterprise scope to use this endpoint.

get /enterprises/{enterprise}/actions/runners

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

per_page integer query

Results per page (max 100)

Default: 30
page integer query

Page number of the results to fetch.

Default: 1

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runners', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
{
  "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 manage_runners:enterprise scope to use this endpoint.

get /enterprises/{enterprise}/actions/runners/downloads

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/downloads
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runners/downloads', {
  enterprise: 'enterprise'
})

Response

Status: 200 OK
[
  {
    "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 manage_runners: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
post /enterprises/{enterprise}/actions/runners/registration-token

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/registration-token
JavaScript (@octokit/core.js)
await octokit.request('POST /enterprises/{enterprise}/actions/runners/registration-token', {
  enterprise: 'enterprise'
})

Response

Status: 201 Created
{
  "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 manage_runners: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
post /enterprises/{enterprise}/actions/runners/remove-token

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

Amostras de código

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/remove-token
JavaScript (@octokit/core.js)
await octokit.request('POST /enterprises/{enterprise}/actions/runners/remove-token', {
  enterprise: 'enterprise'
})

Response

Status: 201 Created
{
  "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 manage_runners:enterprise scope to use this endpoint.

get /enterprises/{enterprise}/actions/runners/{runner_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_id integer path

Unique identifier of the self-hosted runner.

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/42
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runners/{runner_id}', {
  enterprise: 'enterprise',
  runner_id: 42
})

Response

Status: 200 OK
{
  "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 manage_runners:enterprise scope to use this endpoint.

delete /enterprises/{enterprise}/actions/runners/{runner_id}

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_id integer path

Unique identifier of the self-hosted runner.

Amostras de código

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/42
JavaScript (@octokit/core.js)
await octokit.request('DELETE /enterprises/{enterprise}/actions/runners/{runner_id}', {
  enterprise: 'enterprise',
  runner_id: 42
})

Response

Status: 204 No Content

List labels for a self-hosted runner for an enterprise

Note: The Actions Runner Labels API endpoints are currently in beta and are subject to change.

Lists all labels for a self-hosted runner configured in an enterprise.

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

get /enterprises/{enterprise}/actions/runners/{runner_id}/labels

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_id integer path

Unique identifier of the self-hosted runner.

Amostras de código

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/42/labels
JavaScript (@octokit/core.js)
await octokit.request('GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
  enterprise: 'enterprise',
  runner_id: 42
})

Response

Status: 200 OK
{
  "total_count": 4,
  "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"
    }
  ]
}

Resource not found

Status: 404 Not Found

Add custom labels to a self-hosted runner for an enterprise

Note: The Actions Runner Labels API endpoints are currently in beta and are subject to change.

Add custom labels to a self-hosted runner configured in an enterprise.

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

post /enterprises/{enterprise}/actions/runners/{runner_id}/labels

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_id integer path

Unique identifier of the self-hosted runner.

labels array of strings body

Required. The names of the custom labels to add to the runner.

Amostras de código

Shell
curl \
  -X POST \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/42/labels \
  -d '{"labels":["labels"]}'
JavaScript (@octokit/core.js)
await octokit.request('POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
  enterprise: 'enterprise',
  runner_id: 42,
  labels: [
    'labels'
  ]
})

Response

Status: 200 OK
{
  "total_count": 4,
  "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"
    }
  ]
}

Resource not found

Status: 404 Not Found

Validation failed

Status: 422 Unprocessable Entity

Set custom labels for a self-hosted runner for an enterprise

Note: The Actions Runner Labels API endpoints are currently in beta and are subject to change.

Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in an enterprise.

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

put /enterprises/{enterprise}/actions/runners/{runner_id}/labels

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_id integer path

Unique identifier of the self-hosted runner.

labels array of strings body

Required. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels.

Amostras de código

Shell
curl \
  -X PUT \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/42/labels \
  -d '{"labels":["labels"]}'
JavaScript (@octokit/core.js)
await octokit.request('PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
  enterprise: 'enterprise',
  runner_id: 42,
  labels: [
    'labels'
  ]
})

Response

Status: 200 OK
{
  "total_count": 4,
  "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"
    }
  ]
}

Resource not found

Status: 404 Not Found

Validation failed

Status: 422 Unprocessable Entity

Remove all custom labels from a self-hosted runner for an enterprise

Note: The Actions Runner Labels API endpoints are currently in beta and are subject to change.

Remove all custom labels from a self-hosted runner configured in an enterprise. Returns the remaining read-only labels from the runner.

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

delete /enterprises/{enterprise}/actions/runners/{runner_id}/labels

Parâmetros

Name Type In Description
accept string header

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

enterprise string path

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

runner_id integer path

Unique identifier of the self-hosted runner.

Amostras de código

Shell
curl \
  -X DELETE \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/enterprises/ENTERPRISE/actions/runners/42/labels
JavaScript (@octokit/core.js)
await octokit.request('DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
  enterprise: 'enterprise',
  runner_id: 42
})

Response

Status: 200 OK
{
  "total_count": 3,
  "labels": [
    {
      "id": 5,
      "name": "self-hosted",
      "type": "read-only"
    },
    {
      "id": 7,
      "name": "X64",
      "type": "read-only"
    },
    {
      "id": 20,
      "name": "macOS",
      "type": "read-only"
    }
  ]
}

Resource not found

Status: 404 Not Found

Validation failed

Status: 422 Unprocessable Entity

Esse documento ajudou você?

Política de Privacidade

Ajude-nos a tornar esses documentos ótimos!

Todos os documentos do GitHub são de código aberto. Você percebeu que algo que está errado ou não está claro? Envie um pull request.

Faça uma contribuição

Ou, aprenda como contribuir.