Ações
A API de GitHub Actions permite que você gerencie GitHub Actions usando a API REST. Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub exige permissões mencionadas em cada ponto de extremidade. Para obter mais informações, consulte "Documentação do GitHub Actions".
Artefatos
A API de Artefatos permite que você faça o download, exclua e recupere informações sobre artefatos de fluxo de trabalho. Os artefatos permitem compartilhar dados entre tarefas em um fluxo de trabalho e armazenar dados assim que o fluxo de trabalho tiver sido concluído. Para obter mais informações, consulte "Dados recorrentes do fluxo de trabalho que usam artefatos".
Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub deve ter a permissão de ações para usar essa API.
List artifacts for a repository
Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/artifactsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/artifactsawait octokit.request('GET /repos/{owner}/{repo}/actions/artifacts', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/artifactsResponse
Status: 200{
"total_count": 2,
"artifacts": [
{
"id": 11,
"node_id": "MDg6QXJ0aWZhY3QxMQ==",
"name": "Rails",
"size_in_bytes": 556,
"url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11",
"archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip",
"expired": false,
"created_at": "2020-01-10T14:59:22Z",
"expires_at": "2020-03-21T14:59:22Z",
"updated_at": "2020-02-21T14:59:22Z"
},
{
"id": 13,
"node_id": "MDg6QXJ0aWZhY3QxMw==",
"name": "",
"size_in_bytes": 453,
"url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13",
"archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip",
"expired": false,
"created_at": "2020-01-10T14:59:22Z",
"expires_at": "2020-03-21T14:59:22Z",
"updated_at": "2020-02-21T14:59:22Z"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get an artifact
Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/artifacts/{artifact_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
artifact_id | integer | path | artifact_id parameter |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/artifacts/ARTIFACT_IDawait octokit.request('GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}', {
owner: 'OWNER',
repo: 'REPO',
artifact_id: 'ARTIFACT_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/artifacts/ARTIFACT_IDResponse
Status: 200{
"id": 11,
"node_id": "MDg6QXJ0aWZhY3QxMQ==",
"name": "Rails",
"size_in_bytes": 556,
"url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11",
"archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip",
"expired": false,
"created_at": "2020-01-10T14:59:22Z",
"expires_at": "2020-01-21T14:59:22Z",
"updated_at": "2020-01-21T14:59:22Z"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Delete an artifact
Deletes an artifact for a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
delete /repos/{owner}/{repo}/actions/artifacts/{artifact_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
artifact_id | integer | path | artifact_id parameter |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/artifacts/ARTIFACT_IDawait octokit.request('DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}', {
owner: 'OWNER',
repo: 'REPO',
artifact_id: 'ARTIFACT_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/artifacts/ARTIFACT_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Download an artifact
Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for Location: in
the response header to find the URL for the download. The :archive_format must be zip. Anyone with read access to
the repository can use this endpoint. If the repository is private you must use an access token with the repo scope.
GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
artifact_id | integer | path | artifact_id parameter |
archive_format | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/artifacts/ARTIFACT_ID/ARCHIVE_FORMATawait octokit.request('GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}', {
owner: 'OWNER',
repo: 'REPO',
artifact_id: 'ARTIFACT_ID',
archive_format: 'ARCHIVE_FORMAT'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/artifacts/ARTIFACT_ID/ARCHIVE_FORMATResponse
Status: 302Status codes
| HTTP Status Code | Descrição |
|---|---|
302 | Found |
Observações
List workflow run artifacts
Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}/artifactsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/artifactsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/artifactsResponse
Status: 200{
"total_count": 2,
"artifacts": [
{
"id": 11,
"node_id": "MDg6QXJ0aWZhY3QxMQ==",
"name": "Rails",
"size_in_bytes": 556,
"url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11",
"archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/11/zip",
"expired": false,
"created_at": "2020-01-10T14:59:22Z",
"expires_at": "2020-03-21T14:59:22Z",
"updated_at": "2020-02-21T14:59:22Z"
},
{
"id": 13,
"node_id": "MDg6QXJ0aWZhY3QxMw==",
"name": "",
"size_in_bytes": 453,
"url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13",
"archive_download_url": "https://api.github.com/repos/octo-org/octo-docs/actions/artifacts/13/zip",
"expired": false,
"created_at": "2020-01-10T14:59:22Z",
"expires_at": "2020-03-21T14:59:22Z",
"updated_at": "2020-02-21T14:59:22Z"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Cache
The cache API allows you to query and manage the GitHub Actions cache for repositories. Para obter mais informações, consulte "Memorizar dependências para acelerar fluxos de trabalho".
Get GitHub Actions cache usage for an enterprise
Gets the total GitHub Actions cache usage for an enterprise.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
You must authenticate using an access token with the admin:enterprise scope to use this endpoint.
get /enterprises/{enterprise}/actions/cache/usageParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/cache/usageawait octokit.request('GET /enterprises/{enterprise}/actions/cache/usage', {
enterprise: 'ENTERPRISE'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/cache/usageResponse
Status: 200{
"total_active_caches_size_in_bytes": 3344284,
"total_active_caches_count": 5
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get GitHub Actions cache usage for an organization
Gets the total GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
You must authenticate using an access token with the read:org scope to use this endpoint. GitHub Apps must have the organization_admistration:read permission to use this endpoint.
get /orgs/{org}/actions/cache/usageParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/cache/usageawait octokit.request('GET /orgs/{org}/actions/cache/usage', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/cache/usageResponse
Status: 200{
"total_active_caches_size_in_bytes": 3344284,
"total_active_caches_count": 5
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
List repositories with GitHub Actions cache usage for an organization
Lists repositories and their GitHub Actions cache usage for an organization.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
You must authenticate using an access token with the read:org scope to use this endpoint. GitHub Apps must have the organization_admistration:read permission to use this endpoint.
get /orgs/{org}/actions/cache/usage-by-repositoryParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/cache/usage-by-repositoryawait octokit.request('GET /orgs/{org}/actions/cache/usage-by-repository', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/cache/usage-by-repositoryResponse
Status: 200{
"total_count": 2,
"repository_cache_usages": [
{
"full_name": "octo-org/Hello-World",
"active_caches_size_in_bytes": 2322142,
"active_caches_count": 3
},
{
"full_name": "octo-org/server",
"active_caches_size_in_bytes": 1022142,
"active_caches_count": 2
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get GitHub Actions cache usage for a repository
Gets GitHub Actions cache usage for a repository.
The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/cache/usageParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/cache/usageawait octokit.request('GET /repos/{owner}/{repo}/actions/cache/usage', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/cache/usageResponse
Status: 200{
"full_name": "octo-org/Hello-World",
"active_caches_size_in_bytes": 2322142,
"active_caches_count": 3
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Permissões
The Permissions API allows you to set permissions for what enterprises, organizations, and repositories are allowed to run GitHub Actions, and what actions and reusable workflows are allowed to run. For more information, see "Usage limits, billing, and administration."
Get GitHub Actions permissions for an enterprise
Gets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.
You must authenticate using an access token with the admin:enterprise scope to use this endpoint.
get /enterprises/{enterprise}/actions/permissionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissionsawait octokit.request('GET /enterprises/{enterprise}/actions/permissions', {
enterprise: 'ENTERPRISE'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/permissionsResponse
Status: 200{
"enabled_organizations": "all",
"allowed_actions": "selected",
"selected_actions_url": "https://api.github.com/enterprises/2/actions/permissions/selected-actions"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Set GitHub Actions permissions for an enterprise
Sets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.
You must authenticate using an access token with the admin:enterprise scope to use this endpoint.
put /enterprises/{enterprise}/actions/permissionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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: |
allowed_actions | string | body | The permissions policy that controls the actions and reusable workflows that are allowed to run. Can be one of: |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions \
-d '{"enabled_organizations":"all","allowed_actions":"selected"}'await octokit.request('PUT /enterprises/{enterprise}/actions/permissions', {
enterprise: 'ENTERPRISE',
enabled_organizations: 'all',
allowed_actions: 'selected'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/permissions \
-f enabled_organizations='all' -f allowed_actions='selected'Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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/organizationsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizationsawait octokit.request('GET /enterprises/{enterprise}/actions/permissions/organizations', {
enterprise: 'ENTERPRISE'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/permissions/organizationsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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/organizationsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations \
-d '{"selected_organization_ids":[32,91]}'await octokit.request('PUT /enterprises/{enterprise}/actions/permissions/organizations', {
enterprise: 'ENTERPRISE',
selected_organization_ids: [
32,
91
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations/ORG_IDawait octokit.request('PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}', {
enterprise: 'ENTERPRISE',
org_id: 'ORG_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/permissions/organizations/ORG_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions/organizations/ORG_IDawait octokit.request('DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}', {
enterprise: 'ENTERPRISE',
org_id: 'ORG_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/permissions/organizations/ORG_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Get allowed actions and reusable workflows for an enterprise
Gets the selected actions and reusable workflows 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-actionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/permissions/selected-actionsawait octokit.request('GET /enterprises/{enterprise}/actions/permissions/selected-actions', {
enterprise: 'ENTERPRISE'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/permissions/selected-actionsResponse
Status: 200{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Set allowed actions and reusable workflows for an enterprise
Sets the actions and reusable workflows 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-actionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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 |
verified_allowed | boolean | body | Whether actions from GitHub Marketplace verified creators are allowed. Set to |
patterns_allowed | array of strings | body | Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, |
Amostras de código
Example
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,"verified_allowed":false,"patterns_allowed":["monalisa/octocat@*","docker/*"]}'await octokit.request('PUT /enterprises/{enterprise}/actions/permissions/selected-actions', {
enterprise: 'ENTERPRISE',
github_owned_allowed: true,
verified_allowed: false,
patterns_allowed: [
'monalisa/octocat@*',
'docker/*'
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Get GitHub Actions permissions for an organization
Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
get /orgs/{org}/actions/permissionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissionsawait octokit.request('GET /orgs/{org}/actions/permissions', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissionsResponse
Status: 200{
"enabled_repositories": "all",
"allowed_actions": "selected",
"selected_actions_url": "https://api.github.com/organizations/42/actions/permissions/selected-actions"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set GitHub Actions permissions for an organization
Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.
If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions to selected actions and reusable workflows, then you cannot override them for the organization.
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
put /orgs/{org}/actions/permissionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
enabled_repositories | string | body | Required. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: |
allowed_actions | string | body | The permissions policy that controls the actions and reusable workflows that are allowed to run. Can be one of: |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions \
-d '{"enabled_repositories":"all","allowed_actions":"selected"}'await octokit.request('PUT /orgs/{org}/actions/permissions', {
org: 'ORG',
enabled_repositories: 'all',
allowed_actions: 'selected'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissions \
-f enabled_repositories='all' -f allowed_actions='selected'Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
List selected repositories enabled for GitHub Actions in an organization
Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
get /orgs/{org}/actions/permissions/repositoriesParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/repositoriesawait octokit.request('GET /orgs/{org}/actions/permissions/repositories', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissions/repositoriesResponse
Status: 200{
"total_count": 1,
"repositories": [
{
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"clone_url": "https://github.com/octocat/Hello-World.git",
"mirror_url": "git:git.example.com/octocat/Hello-World",
"hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
"svn_url": "https://svn.github.com/octocat/Hello-World",
"homepage": "https://github.com",
"language": null,
"forks_count": 9,
"stargazers_count": 80,
"watchers_count": 80,
"size": 108,
"default_branch": "master",
"open_issues_count": 0,
"is_template": true,
"topics": [
"octocat",
"atom",
"electron",
"api"
],
"has_issues": true,
"has_projects": true,
"has_wiki": true,
"has_pages": false,
"has_downloads": true,
"archived": false,
"disabled": false,
"visibility": "public",
"pushed_at": "2011-01-26T19:06:43Z",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:14:43Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"allow_rebase_merge": true,
"template_repository": null,
"temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
"allow_squash_merge": true,
"allow_auto_merge": false,
"delete_branch_on_merge": true,
"allow_merge_commit": true,
"subscribers_count": 42,
"network_count": 0,
"license": {
"key": "mit",
"name": "MIT License",
"url": "https://api.github.com/licenses/mit",
"spdx_id": "MIT",
"node_id": "MDc6TGljZW5zZW1pdA==",
"html_url": "https://github.com/licenses/mit"
},
"forks": 1,
"open_issues": 1,
"watchers": 1
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set selected repositories enabled for GitHub Actions in an organization
Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
put /orgs/{org}/actions/permissions/repositoriesParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
selected_repository_ids | array of integers | body | Required. List of repository IDs to enable for GitHub Actions. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/repositories \
-d '{"selected_repository_ids":[32,42]}'await octokit.request('PUT /orgs/{org}/actions/permissions/repositories', {
org: 'ORG',
selected_repository_ids: [
32,
42
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Enable a selected repository for GitHub Actions in an organization
Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
put /orgs/{org}/actions/permissions/repositories/{repository_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
repository_id | integer | path |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/repositories/REPOSITORY_IDawait octokit.request('PUT /orgs/{org}/actions/permissions/repositories/{repository_id}', {
org: 'ORG',
repository_id: 'REPOSITORY_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissions/repositories/REPOSITORY_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Disable a selected repository for GitHub Actions in an organization
Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
delete /orgs/{org}/actions/permissions/repositories/{repository_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
repository_id | integer | path |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/repositories/REPOSITORY_IDawait octokit.request('DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}', {
org: 'ORG',
repository_id: 'REPOSITORY_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissions/repositories/REPOSITORY_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Get allowed actions and reusable workflows for an organization
Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization.""
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
get /orgs/{org}/actions/permissions/selected-actionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/selected-actionsawait octokit.request('GET /orgs/{org}/actions/permissions/selected-actions', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissions/selected-actionsResponse
Status: 200{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set allowed actions and reusable workflows for an organization
Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for an organization."
If the organization belongs to an enterprise that has selected actions and reusable workflows set at the enterprise level, then you cannot override any of the enterprise's allowed actions and reusable workflows settings.
To use the patterns_allowed setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the patterns_allowed setting only applies to public repositories in the organization.
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
put /orgs/{org}/actions/permissions/selected-actionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
github_owned_allowed | boolean | body | Whether GitHub-owned actions are allowed. For example, this includes the actions in the |
verified_allowed | boolean | body | Whether actions from GitHub Marketplace verified creators are allowed. Set to |
patterns_allowed | array of strings | body | Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/selected-actions \
-d '{"github_owned_allowed":true,"verified_allowed":false,"patterns_allowed":["monalisa/octocat@*","docker/*"]}'await octokit.request('PUT /orgs/{org}/actions/permissions/selected-actions', {
org: 'ORG',
github_owned_allowed: true,
verified_allowed: false,
patterns_allowed: [
'monalisa/octocat@*',
'docker/*'
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Get default workflow permissions for an organization
Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization,
as well if GitHub Actions can submit approving pull request reviews.
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
get /orgs/{org}/actions/permissions/workflowParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/workflowawait octokit.request('GET /orgs/{org}/actions/permissions/workflow', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissions/workflowResponse
Status: 200{
"default_workflow_permissions": "read",
"can_approve_pull_request_reviews": true
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set default workflow permissions for an organization
Sets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization, and sets if GitHub Actions
can submit approving pull request reviews.
You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the administration organization permission to use this API.
put /orgs/{org}/actions/permissions/workflowParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
default_workflow_permissions | string | body | The default workflow permissions granted to the GITHUB_TOKEN when running workflows. |
can_approve_pull_request_reviews | boolean | body | Whether GitHub Actions can submit approving pull request reviews. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/permissions/workflow \
-d '{"default_workflow_permissions":"read","can_approve_pull_request_reviews":true}'await octokit.request('PUT /orgs/{org}/actions/permissions/workflow', {
org: 'ORG',
default_workflow_permissions: 'read',
can_approve_pull_request_reviews: true
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/permissions/workflow \
-f default_workflow_permissions='read' -F can_approve_pull_request_reviews=trueResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Get GitHub Actions permissions for a repository
Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository.
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.
get /repos/{owner}/{repo}/actions/permissionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/permissionsawait octokit.request('GET /repos/{owner}/{repo}/actions/permissions', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/permissionsResponse
Status: 200{
"enabled": true,
"allowed_actions": "selected",
"selected_actions_url": "https://api.github.com/repositories/42/actions/permissions/selected-actions"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set GitHub Actions permissions for a repository
Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.
If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as allowed_actions to selected actions and reusable workflows, then you cannot override them for the repository.
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.
put /repos/{owner}/{repo}/actions/permissionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
enabled | boolean | body | Required. Whether GitHub Actions is enabled on the repository. |
allowed_actions | string | body | The permissions policy that controls the actions and reusable workflows that are allowed to run. Can be one of: |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/permissions \
-d '{"enabled":true,"allowed_actions":"selected"}'await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions', {
owner: 'OWNER',
repo: 'REPO',
enabled: true,
allowed_actions: 'selected'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/permissions \
-F enabled=true -f allowed_actions='selected'Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Get the level of access for workflows outside of the repository
Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal repositories. For more information, see "Managing GitHub Actions settings for a repository."
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the
repository administration permission to use this endpoint.
get /repos/{owner}/{repo}/actions/permissions/accessParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/permissions/accessawait octokit.request('GET /repos/{owner}/{repo}/actions/permissions/access', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/permissions/accessResponse
Status: 200{
"access_level": "organization"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set the level of access for workflows outside of the repository
Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to internal repositories. For more information, see "Managing GitHub Actions settings for a repository."
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the
repository administration permission to use this endpoint.
put /repos/{owner}/{repo}/actions/permissions/accessParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
access_level | string | body | Required. Defines the level of access that workflows outside of the repository have to actions and reusable workflows within the
repository. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/permissions/access \
-d '{"access_level":"organization"}'await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions/access', {
owner: 'OWNER',
repo: 'REPO',
access_level: 'organization'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/permissions/access \
-f access_level='organization'Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Get allowed actions and reusable workflows for a repository
Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for a repository."
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.
get /repos/{owner}/{repo}/actions/permissions/selected-actionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/permissions/selected-actionsawait octokit.request('GET /repos/{owner}/{repo}/actions/permissions/selected-actions', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/permissions/selected-actionsResponse
Status: 200{
"github_owned_allowed": true,
"verified_allowed": false,
"patterns_allowed": [
"monalisa/octocat@*",
"docker/*"
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set allowed actions and reusable workflows for a repository
Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions must be configured to selected. For more information, see "Set GitHub Actions permissions for a repository."
If the repository belongs to an organization or enterprise that has selected actions and reusable workflows set at the organization or enterprise levels, then you cannot override any of the allowed actions and reusable workflows settings.
To use the patterns_allowed setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the patterns_allowed setting only applies to public repositories.
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.
put /repos/{owner}/{repo}/actions/permissions/selected-actionsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
github_owned_allowed | boolean | body | Whether GitHub-owned actions are allowed. For example, this includes the actions in the |
verified_allowed | boolean | body | Whether actions from GitHub Marketplace verified creators are allowed. Set to |
patterns_allowed | array of strings | body | Specifies a list of string-matching patterns to allow specific action(s) and reusable workflow(s). Wildcards, tags, and SHAs are allowed. For example, |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/permissions/selected-actions \
-d '{"github_owned_allowed":true,"verified_allowed":false,"patterns_allowed":["monalisa/octocat@*","docker/*"]}'await octokit.request('PUT /repos/{owner}/{repo}/actions/permissions/selected-actions', {
owner: 'OWNER',
repo: 'REPO',
github_owned_allowed: true,
verified_allowed: false,
patterns_allowed: [
'monalisa/octocat@*',
'docker/*'
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Segredos
A API Segredos permite criar, atualizar, excluir e recuperar informações sobre segredos criptografados. Os segredos criptografados permitem que você armazene informações confidenciais, como tokens de acesso, no repositório, ambientes do repositório, ou organização. Para obter mais informações, consulte "Criando e usando segredos encriptados".
Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub deve ter a permissão segredos para usar esta API. Os usuários autenticados devem ter acesso de colaborador em um repositório para criar, atualizar ou ler segredos.
List organization secrets
Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
get /orgs/{org}/actions/secretsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secretsawait octokit.request('GET /orgs/{org}/actions/secrets', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/secretsResponse
Status: 200{
"total_count": 3,
"secrets": [
{
"name": "GIST_ID",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z",
"visibility": "private"
},
{
"name": "DEPLOY_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z",
"visibility": "all"
},
{
"name": "GH_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z",
"visibility": "selected",
"selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get an organization public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
get /orgs/{org}/actions/secrets/public-keyParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/public-keyawait octokit.request('GET /orgs/{org}/actions/secrets/public-key', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/secrets/public-keyResponse
Status: 200{
"key_id": "012345678912345678",
"key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get an organization secret
Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
get /orgs/{org}/actions/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
secret_name | string | path | secret_name parameter |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAMEawait octokit.request('GET /orgs/{org}/actions/secrets/{secret_name}', {
org: 'ORG',
secret_name: 'SECRET_NAME'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/secrets/SECRET_NAMEResponse
Status: 200{
"name": "GH_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z",
"visibility": "selected",
"selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Create or update an organization secret
Creates or updates an organization secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to
use this endpoint.
Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
put /orgs/{org}/actions/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
secret_name | string | path | secret_name parameter |
encrypted_value | string | body | Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an organization public key endpoint. |
key_id | string | body | ID of the key you used to encrypt the secret. |
visibility | string | body | Required. Configures the access that repositories have to the organization secret. Can be one of: |
selected_repository_ids | array of strings | body | An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME \
-d '{"encrypted_value":"c2VjcmV0","key_id":"012345678912345678","visibility":"selected","selected_repository_ids":["1296269","1296280"]}'await octokit.request('PUT /orgs/{org}/actions/secrets/{secret_name}', {
org: 'ORG',
secret_name: 'SECRET_NAME',
encrypted_value: 'c2VjcmV0',
key_id: '012345678912345678',
visibility: 'selected',
selected_repository_ids: [
'1296269',
'1296280'
]
})Response when creating a secret
Status: 201Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME \
-d '{"encrypted_value":"c2VjcmV0","key_id":"012345678912345678","visibility":"selected","selected_repository_ids":["1296269","1296280"]}'await octokit.request('PUT /orgs/{org}/actions/secrets/{secret_name}', {
org: 'ORG',
secret_name: 'SECRET_NAME',
encrypted_value: 'c2VjcmV0',
key_id: '012345678912345678',
visibility: 'selected',
selected_repository_ids: [
'1296269',
'1296280'
]
})Response when updating a secret
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Response when creating a secret |
204 | Response when updating a secret |
Observações
Delete an organization secret
Deletes a secret in an organization using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
delete /orgs/{org}/actions/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
secret_name | string | path | secret_name parameter |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAMEawait octokit.request('DELETE /orgs/{org}/actions/secrets/{secret_name}', {
org: 'ORG',
secret_name: 'SECRET_NAME'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/secrets/SECRET_NAMEResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
List selected repositories for an organization secret
Lists all repositories that have been selected when the visibility for repository access to a secret is set to selected. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
get /orgs/{org}/actions/secrets/{secret_name}/repositoriesParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
secret_name | string | path | secret_name parameter |
page | integer | query | Page number of the results to fetch. Padrão: |
per_page | integer | query | Results per page (max 100) Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositoriesawait octokit.request('GET /orgs/{org}/actions/secrets/{secret_name}/repositories', {
org: 'ORG',
secret_name: 'SECRET_NAME'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/secrets/SECRET_NAME/repositoriesResponse
Status: 200{
"total_count": 1,
"repositories": [
{
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set selected repositories for an organization secret
Replaces all repositories for an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
put /orgs/{org}/actions/secrets/{secret_name}/repositoriesParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
secret_name | string | path | secret_name parameter |
selected_repository_ids | array of integers | body | Required. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositories \
-d '{"selected_repository_ids":[64780797]}'await octokit.request('PUT /orgs/{org}/actions/secrets/{secret_name}/repositories', {
org: 'ORG',
secret_name: 'SECRET_NAME',
selected_repository_ids: [
64780797
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Add selected repository to an organization secret
Adds a repository to an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
put /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
secret_name | string | path | secret_name parameter |
repository_id | integer | path |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositories/REPOSITORY_IDawait octokit.request('PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}', {
org: 'ORG',
secret_name: 'SECRET_NAME',
repository_id: 'REPOSITORY_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/secrets/SECRET_NAME/repositories/REPOSITORY_IDNo Content when repository was added to the selected list
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content when repository was added to the selected list |
409 | Conflict when visibility type is not set to selected |
Observações
Remove selected repository from an organization secret
Removes a repository from an organization secret when the visibility for repository access is set to selected. The visibility is set when you Create or update an organization secret. You must authenticate using an access token with the admin:org scope to use this endpoint. GitHub Apps must have the secrets organization permission to use this endpoint.
delete /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
secret_name | string | path | secret_name parameter |
repository_id | integer | path |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/secrets/SECRET_NAME/repositories/REPOSITORY_IDawait octokit.request('DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}', {
org: 'ORG',
secret_name: 'SECRET_NAME',
repository_id: 'REPOSITORY_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/secrets/SECRET_NAME/repositories/REPOSITORY_IDResponse when repository was removed from the selected list
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | Response when repository was removed from the selected list |
409 | Conflict when visibility type not set to selected |
Observações
List repository secrets
Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.
get /repos/{owner}/{repo}/actions/secretsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/secretsawait octokit.request('GET /repos/{owner}/{repo}/actions/secrets', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/secretsResponse
Status: 200{
"total_count": 2,
"secrets": [
{
"name": "GH_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z"
},
{
"name": "GIST_ID",
"created_at": "2020-01-10T10:59:22Z",
"updated_at": "2020-01-11T11:59:22Z"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get a repository public key
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the secrets repository permission to use this endpoint.
get /repos/{owner}/{repo}/actions/secrets/public-keyParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/secrets/public-keyawait octokit.request('GET /repos/{owner}/{repo}/actions/secrets/public-key', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/secrets/public-keyResponse
Status: 200{
"key_id": "012345678912345678",
"key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get a repository secret
Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.
get /repos/{owner}/{repo}/actions/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
secret_name | string | path | secret_name parameter |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/secrets/SECRET_NAMEawait octokit.request('GET /repos/{owner}/{repo}/actions/secrets/{secret_name}', {
owner: 'OWNER',
repo: 'REPO',
secret_name: 'SECRET_NAME'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/secrets/SECRET_NAMEResponse
Status: 200{
"name": "GH_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Create or update a repository secret
Creates or updates a repository secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use
this endpoint.
Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
put /repos/{owner}/{repo}/actions/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
secret_name | string | path | secret_name parameter |
encrypted_value | string | body | Value for your secret, encrypted with LibSodium using the public key retrieved from the Get a repository public key endpoint. |
key_id | string | body | ID of the key you used to encrypt the secret. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/secrets/SECRET_NAME \
-d '{"encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'await octokit.request('PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}', {
owner: 'OWNER',
repo: 'REPO',
secret_name: 'SECRET_NAME',
encrypted_value: 'c2VjcmV0',
key_id: '012345678912345678'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/secrets/SECRET_NAME \
-f encrypted_value='c2VjcmV0' -f key_id='012345678912345678'Response when creating a secret
Status: 201Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/secrets/SECRET_NAME \
-d '{"encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'await octokit.request('PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}', {
owner: 'OWNER',
repo: 'REPO',
secret_name: 'SECRET_NAME',
encrypted_value: 'c2VjcmV0',
key_id: '012345678912345678'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/secrets/SECRET_NAME \
-f encrypted_value='c2VjcmV0' -f key_id='012345678912345678'Response when updating a secret
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Response when creating a secret |
204 | Response when updating a secret |
Observações
Delete a repository secret
Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.
delete /repos/{owner}/{repo}/actions/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
secret_name | string | path | secret_name parameter |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/secrets/SECRET_NAMEawait octokit.request('DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}', {
owner: 'OWNER',
repo: 'REPO',
secret_name: 'SECRET_NAME'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/secrets/SECRET_NAMEResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
List environment secrets
Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.
get /repositories/{repository_id}/environments/{environment_name}/secretsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
repository_id | integer | path | |
environment_name | string | path | The name of the environment |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secretsawait octokit.request('GET /repositories/{repository_id}/environments/{environment_name}/secrets', {
repository_id: 'REPOSITORY_ID',
environment_name: 'ENVIRONMENT_NAME'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secretsResponse
Status: 200{
"total_count": 2,
"secrets": [
{
"name": "GH_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z"
},
{
"name": "GIST_ID",
"created_at": "2020-01-10T10:59:22Z",
"updated_at": "2020-01-11T11:59:22Z"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get an environment public key
Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the secrets repository permission to use this endpoint.
get /repositories/{repository_id}/environments/{environment_name}/secrets/public-keyParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
repository_id | integer | path | |
environment_name | string | path | The name of the environment |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/public-keyawait octokit.request('GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key', {
repository_id: 'REPOSITORY_ID',
environment_name: 'ENVIRONMENT_NAME'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/public-keyResponse
Status: 200{
"key_id": "012345678912345678",
"key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get an environment secret
Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.
get /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
repository_id | integer | path | |
environment_name | string | path | The name of the environment |
secret_name | string | path | secret_name parameter |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAMEawait octokit.request('GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}', {
repository_id: 'REPOSITORY_ID',
environment_name: 'ENVIRONMENT_NAME',
secret_name: 'SECRET_NAME'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAMEResponse
Status: 200{
"name": "GH_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Create or update an environment secret
Creates or updates an environment secret with an encrypted value. Encrypt your secret using
LibSodium. You must authenticate using an access
token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use
this endpoint.
Example encrypting a secret using Node.js
Encrypt your secret using the tweetsodium library.
const sodium = require('tweetsodium');
const key = "base64-encoded-public-key";
const value = "plain-text-secret";
// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
console.log(encrypted);
Example encrypting a secret using Python
Encrypt your secret using pynacl with Python 3.
from base64 import b64encode
from nacl import encoding, public
def encrypt(public_key: str, secret_value: str) -> str:
"""Encrypt a Unicode string using the public key."""
public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder())
sealed_box = public.SealedBox(public_key)
encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
return b64encode(encrypted).decode("utf-8")
Example encrypting a secret using C#
Encrypt your secret using the Sodium.Core package.
var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret");
var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=");
var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);
Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));
Example encrypting a secret using Ruby
Encrypt your secret using the rbnacl gem.
require "rbnacl"
require "base64"
key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=")
public_key = RbNaCl::PublicKey.new(key)
box = RbNaCl::Boxes::Sealed.from_public_key(public_key)
encrypted_secret = box.encrypt("my_secret")
# Print the base64 encoded secret
puts Base64.strict_encode64(encrypted_secret)
put /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
repository_id | integer | path | |
environment_name | string | path | The name of the environment |
secret_name | string | path | secret_name parameter |
encrypted_value | string | body | Required. Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an environment public key endpoint. |
key_id | string | body | Required. ID of the key you used to encrypt the secret. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAME \
-d '{"encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'await octokit.request('PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}', {
repository_id: 'REPOSITORY_ID',
environment_name: 'ENVIRONMENT_NAME',
secret_name: 'SECRET_NAME',
encrypted_value: 'c2VjcmV0',
key_id: '012345678912345678'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAME \
-f encrypted_value='c2VjcmV0' -f key_id='012345678912345678'Response when creating a secret
Status: 201Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAME \
-d '{"encrypted_value":"c2VjcmV0","key_id":"012345678912345678"}'await octokit.request('PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}', {
repository_id: 'REPOSITORY_ID',
environment_name: 'ENVIRONMENT_NAME',
secret_name: 'SECRET_NAME',
encrypted_value: 'c2VjcmV0',
key_id: '012345678912345678'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAME \
-f encrypted_value='c2VjcmV0' -f key_id='012345678912345678'Response when updating a secret
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Response when creating a secret |
204 | Response when updating a secret |
Observações
Delete an environment secret
Deletes a secret in an environment using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.
delete /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
repository_id | integer | path | |
environment_name | string | path | The name of the environment |
secret_name | string | path | secret_name parameter |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAMEawait octokit.request('DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}', {
repository_id: 'REPOSITORY_ID',
environment_name: 'ENVIRONMENT_NAME',
secret_name: 'SECRET_NAME'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repositories/REPOSITORY_ID/environments/ENVIRONMENT_NAME/secrets/SECRET_NAMEDefault response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | Default response |
Observações
Grupos de runner auto-hospedados
A API dos Grupos de Runners auto-hospedados permite que você gerencie grupos de runners auto-hospedados. Para obter mais informações, consulte "Gerenciando acesso a runners auto-hospedados usando grupos".
Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub deve ter a permissão de administração `para repositórios ou a permissãoorganization_self_hosted_runnerspara as organizações. Os usuários autenticados devem ter acesso de administrador a repositórios ou organizações ou ao escopomanage_runners:corporativo` para que as empresas usem esta API.
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-groupsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
visible_to_organization | string | query | Only return runner groups that are allowed to be used by this organization. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groupsawait octokit.request('GET /enterprises/{enterprise}/actions/runner-groups', {
enterprise: 'ENTERPRISE'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groupsResponse
Status: 200{
"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,
"restricted_to_workflows": false,
"selected_workflows": [],
"workflow_restrictions_read_only": 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,
"restricted_to_workflows": true,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
},
{
"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,
"restricted_to_workflows": false,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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-groupsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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: |
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 |
restricted_to_workflows | boolean | body | If |
selected_workflows | array of strings | body | List of workflows the runner group should be allowed to run. This setting will be ignored unless |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups \
-d '{"name":"Expensive hardware runners","visibility":"selected","selected_organization_ids":[32,91],"runners":[9,2]}'await octokit.request('POST /enterprises/{enterprise}/actions/runner-groups', {
enterprise: 'ENTERPRISE',
name: 'Expensive hardware runners',
visibility: 'selected',
selected_organization_ids: [
32,
91
],
runners: [
9,
2
]
})Response
Status: 201{
"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,
"restricted_to_workflows": true,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_IDawait octokit.request('GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_IDResponse
Status: 200{
"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,
"restricted_to_workflows": true,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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: Padrão: |
allows_public_repositories | boolean | body | Whether the runner group can be used by |
restricted_to_workflows | boolean | body | If |
selected_workflows | array of strings | body | List of workflows the runner group should be allowed to run. This setting will be ignored unless |
Amostras de código
Example
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID \
-d '{"name":"Expensive hardware runners","visibility":"selected"}'await octokit.request('PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID',
name: 'Expensive hardware runners',
visibility: 'selected'
})gh api \
--method PATCH \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID \
-f name='Expensive hardware runners' -f visibility='selected'Response
Status: 200{
"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,
"restricted_to_workflows": false,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_IDawait octokit.request('DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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}/organizationsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/organizationsawait octokit.request('GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/organizationsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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}/organizationsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/organizations \
-d '{"selected_organization_ids":[32,91]}'await octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID',
selected_organization_ids: [
32,
91
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/organizations/ORG_IDawait octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID',
org_id: 'ORG_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/organizations/ORG_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/organizations/ORG_IDawait octokit.request('DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID',
org_id: 'ORG_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/organizations/ORG_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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}/runnersParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/runnersawait octokit.request('GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/runnersResponse
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"
}
]
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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}/runnersParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/runners \
-d '{"runners":[9,2]}'await octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID',
runners: [
9,
2
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDawait octokit.request('PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID',
runner_id: 'RUNNER_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDawait octokit.request('DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
enterprise: 'ENTERPRISE',
runner_group_id: 'RUNNER_GROUP_ID',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
List self-hosted runner groups for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.
You must authenticate using an access token with the admin:org scope to use this endpoint.
get /orgs/{org}/actions/runner-groupsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
visible_to_repository | string | query | Only return runner groups that are allowed to be used by this repository. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groupsawait octokit.request('GET /orgs/{org}/actions/runner-groups', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groupsResponse
Status: 200{
"total_count": 3,
"runner_groups": [
{
"id": 1,
"name": "Default",
"visibility": "all",
"default": true,
"runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners",
"inherited": false,
"allows_public_repositories": true,
"restricted_to_workflows": false,
"selected_workflows": [],
"workflow_restrictions_read_only": false
},
{
"id": 2,
"name": "octo-runner-group",
"visibility": "selected",
"default": false,
"selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories",
"runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
"inherited": true,
"allows_public_repositories": true,
"restricted_to_workflows": true,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": true
},
{
"id": 3,
"name": "expensive-hardware",
"visibility": "private",
"default": false,
"runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners",
"inherited": false,
"allows_public_repositories": true,
"restricted_to_workflows": false,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Create a self-hosted runner group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "GitHub's products."
Creates a new self-hosted runner group for an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
post /orgs/{org}/actions/runner-groupsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
name | string | body | Required. Name of the runner group. |
visibility | string | body | Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: Padrão: |
selected_repository_ids | array of integers | body | List of repository 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 |
restricted_to_workflows | boolean | body | If |
selected_workflows | array of strings | body | List of workflows the runner group should be allowed to run. This setting will be ignored unless |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups \
-d '{"name":"Expensive hardware runners","visibility":"selected","selected_repository_ids":[32,91],"runners":[9,2]}'await octokit.request('POST /orgs/{org}/actions/runner-groups', {
org: 'ORG',
name: 'Expensive hardware runners',
visibility: 'selected',
selected_repository_ids: [
32,
91
],
runners: [
9,
2
]
})Response
Status: 201{
"id": 2,
"name": "octo-runner-group",
"visibility": "selected",
"default": false,
"selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner-groups/2/repositories",
"runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
"inherited": false,
"allows_public_repositories": true,
"restricted_to_workflows": true,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
Observações
Get a self-hosted runner group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Gets a specific self-hosted runner group for an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
get /orgs/{org}/actions/runner-groups/{runner_group_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_IDawait octokit.request('GET /orgs/{org}/actions/runner-groups/{runner_group_id}', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_IDResponse
Status: 200{
"id": 2,
"name": "octo-runner-group",
"visibility": "selected",
"default": false,
"selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories",
"runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
"inherited": false,
"allows_public_repositories": true,
"restricted_to_workflows": true,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Update a self-hosted runner group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Updates the name and visibility of a self-hosted runner group in an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
patch /orgs/{org}/actions/runner-groups/{runner_group_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
name | string | body | Required. Name of the runner group. |
visibility | string | body | Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: |
allows_public_repositories | boolean | body | Whether the runner group can be used by |
restricted_to_workflows | boolean | body | If |
selected_workflows | array of strings | body | List of workflows the runner group should be allowed to run. This setting will be ignored unless |
Amostras de código
Example
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID \
-d '{"name":"Expensive hardware runners","visibility":"selected"}'await octokit.request('PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID',
name: 'Expensive hardware runners',
visibility: 'selected'
})gh api \
--method PATCH \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID \
-f name='Expensive hardware runners' -f visibility='selected'Response
Status: 200{
"id": 2,
"name": "octo-runner-group",
"visibility": "selected",
"default": false,
"selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/runner-groups/2/repositories",
"runners_url": "https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners",
"inherited": false,
"allows_public_repositories": true,
"restricted_to_workflows": true,
"selected_workflows": [
"octo-org/octo-repo/.github/workflows/deploy.yaml@refs/heads/main"
],
"workflow_restrictions_read_only": false
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Delete a self-hosted runner group from an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Deletes a self-hosted runner group for an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
delete /orgs/{org}/actions/runner-groups/{runner_group_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_IDawait octokit.request('DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
List repository access to a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "GitHub's products."
Lists the repositories with access to a self-hosted runner group configured in an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
get /orgs/{org}/actions/runner-groups/{runner_group_id}/repositoriesParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
page | integer | query | Page number of the results to fetch. Padrão: |
per_page | integer | query | Results per page (max 100) Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/repositoriesawait octokit.request('GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/repositoriesResponse
Status: 200{
"total_count": 1,
"repositories": [
{
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"clone_url": "https://github.com/octocat/Hello-World.git",
"mirror_url": "git:git.example.com/octocat/Hello-World",
"hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
"svn_url": "https://svn.github.com/octocat/Hello-World",
"homepage": "https://github.com",
"language": null,
"forks_count": 9,
"stargazers_count": 80,
"watchers_count": 80,
"size": 108,
"default_branch": "master",
"open_issues_count": 0,
"is_template": true,
"topics": [
"octocat",
"atom",
"electron",
"api"
],
"has_issues": true,
"has_projects": true,
"has_wiki": true,
"has_pages": false,
"has_downloads": true,
"archived": false,
"disabled": false,
"visibility": "public",
"pushed_at": "2011-01-26T19:06:43Z",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:14:43Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"template_repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"clone_url": "https://github.com/octocat/Hello-World.git",
"mirror_url": "git:git.example.com/octocat/Hello-World",
"hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks",
"svn_url": "https://svn.github.com/octocat/Hello-World",
"homepage": "https://github.com",
"organization": null,
"language": null,
"forks": 9,
"forks_count": 9,
"stargazers_count": 80,
"watchers_count": 80,
"watchers": 80,
"size": 108,
"default_branch": "master",
"open_issues": 0,
"open_issues_count": 0,
"is_template": true,
"license": {
"key": "mit",
"name": "MIT License",
"url": "https://api.github.com/licenses/mit",
"spdx_id": "MIT",
"node_id": "MDc6TGljZW5zZW1pdA==",
"html_url": "https://api.github.com/licenses/mit"
},
"topics": [
"octocat",
"atom",
"electron",
"api"
],
"has_issues": true,
"has_projects": true,
"has_wiki": true,
"has_pages": false,
"has_downloads": true,
"archived": false,
"disabled": false,
"visibility": "public",
"pushed_at": "2011-01-26T19:06:43Z",
"created_at": "2011-01-26T19:01:12Z",
"updated_at": "2011-01-26T19:14:43Z",
"permissions": {
"admin": false,
"push": false,
"pull": true
},
"allow_rebase_merge": true,
"template_repository": null,
"temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
"allow_squash_merge": true,
"allow_auto_merge": false,
"delete_branch_on_merge": true,
"allow_merge_commit": true,
"subscribers_count": 42,
"network_count": 0
},
"temp_clone_token": "ABTLWHOULUVAXGTRYU7OC2876QJ2O",
"delete_branch_on_merge": true,
"subscribers_count": 42,
"network_count": 0,
"license": {
"key": "mit",
"name": "MIT License",
"url": "https://api.github.com/licenses/mit",
"spdx_id": "MIT",
"node_id": "MDc6TGljZW5zZW1pdA=="
},
"forks": 1,
"open_issues": 1,
"watchers": 1
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set repository access for a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
put /orgs/{org}/actions/runner-groups/{runner_group_id}/repositoriesParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
selected_repository_ids | array of integers | body | Required. List of repository IDs that can access the runner group. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/repositories \
-d '{"selected_repository_ids":[32,91]}'await octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID',
selected_repository_ids: [
32,
91
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Add repository access to a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Adds a repository to the list of selected repositories 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 organization."
You must authenticate using an access token with the admin:org
scope to use this endpoint.
put /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
repository_id | integer | path |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/repositories/REPOSITORY_IDawait octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID',
repository_id: 'REPOSITORY_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/repositories/REPOSITORY_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Remove repository access to a self-hosted runner group in an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Removes a repository from the list of selected repositories 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 organization."
You must authenticate using an access token with the admin:org scope to use this endpoint.
delete /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
repository_id | integer | path |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/repositories/REPOSITORY_IDawait octokit.request('DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID',
repository_id: 'REPOSITORY_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/repositories/REPOSITORY_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
List self-hosted runners in a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Lists self-hosted runners that are in a specific organization group.
You must authenticate using an access token with the admin:org scope to use this endpoint.
get /orgs/{org}/actions/runner-groups/{runner_group_id}/runnersParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_group_id | integer | path | Unique identifier of the self-hosted runner group. |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/runnersawait octokit.request('GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/runnersResponse
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"
}
]
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Set self-hosted runners in a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Replaces the list of self-hosted runners that are part of an organization runner group.
You must authenticate using an access token with the admin:org scope to use this endpoint.
put /orgs/{org}/actions/runner-groups/{runner_group_id}/runnersParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/runners \
-d '{"runners":[9,2]}'await octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID',
runners: [
9,
2
]
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Add a self-hosted runner to a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Adds a self-hosted runner to a runner group configured in an organization.
You must authenticate using an access token with the admin:org
scope to use this endpoint.
put /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDawait octokit.request('PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID',
runner_id: 'RUNNER_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Remove a self-hosted runner from a group for an organization
The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "GitHub's products."
Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.
You must authenticate using an access token with the admin:org scope to use this endpoint.
delete /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
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
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDawait octokit.request('DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}', {
org: 'ORG',
runner_group_id: 'RUNNER_GROUP_ID',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runner-groups/RUNNER_GROUP_ID/runners/RUNNER_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Executores auto-hospedados
A API de executores auto-hospedados permite que você registre, visualize e exclua executores auto-hospedados. Você pode hospedar seus próprios executores e personalizar o ambiente usado para executar trabalhos nos seus fluxos de trabalho do GitHub Actions. Para obter mais informações, consulte "Hospedando seus próprios executores".
Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub deve ter a permissão de administração `para repositórios ou a permissãoorganization_self_hosted_runnerspara as organizações. Os usuários autenticados devem ter acesso de administrador a repositórios ou organizações ou ao escopomanage_runners:corporativo` para que as empresas usem esta API.
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/runnersParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runnersawait octokit.request('GET /enterprises/{enterprise}/actions/runners', {
enterprise: 'ENTERPRISE'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runnersResponse
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"
}
]
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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/downloadsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/downloadsawait octokit.request('GET /enterprises/{enterprise}/actions/runners/downloads', {
enterprise: 'ENTERPRISE'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/downloadsResponse
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"
}
]Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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-tokenParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/registration-tokenawait octokit.request('POST /enterprises/{enterprise}/actions/runners/registration-token', {
enterprise: 'ENTERPRISE'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/registration-tokenResponse
Status: 201{
"token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-22T12:13:35.123-08:00"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
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-tokenParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/remove-tokenawait octokit.request('POST /enterprises/{enterprise}/actions/runners/remove-token', {
enterprise: 'ENTERPRISE'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/remove-tokenResponse
Status: 201{
"token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-29T12:13:35.123-08:00"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/RUNNER_IDawait octokit.request('GET /enterprises/{enterprise}/actions/runners/{runner_id}', {
enterprise: 'ENTERPRISE',
runner_id: 'RUNNER_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/RUNNER_IDResponse
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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
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
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/RUNNER_IDawait octokit.request('DELETE /enterprises/{enterprise}/actions/runners/{runner_id}', {
enterprise: 'ENTERPRISE',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/RUNNER_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
List labels for a self-hosted runner for an enterprise
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}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labelsawait octokit.request('GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
enterprise: 'ENTERPRISE',
runner_id: 'RUNNER_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labelsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
Add custom labels to a self-hosted runner for an enterprise
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}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'await octokit.request('POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
enterprise: 'ENTERPRISE',
runner_id: 'RUNNER_ID',
labels: [
'gpu',
'accelerated'
]
})Response
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Set custom labels for a self-hosted runner for an enterprise
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}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'await octokit.request('PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
enterprise: 'ENTERPRISE',
runner_id: 'RUNNER_ID',
labels: [
'gpu',
'accelerated'
]
})Response
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Remove all custom labels from a self-hosted runner for an enterprise
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}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labelsawait octokit.request('DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels', {
enterprise: 'ENTERPRISE',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labelsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Remove a custom label from a self-hosted runner for an enterprise
Remove a custom label from a self-hosted runner configured in an enterprise. Returns the remaining labels from the runner.
This endpoint returns a 404 Not Found status if the custom label is not
present on 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/{name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
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. |
name | string | path | The name of a self-hosted runner's custom label. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labels/NAMEawait octokit.request('DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}', {
enterprise: 'ENTERPRISE',
runner_id: 'RUNNER_ID',
name: 'NAME'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/enterprises/ENTERPRISE/actions/runners/RUNNER_ID/labels/NAMEResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
List self-hosted runners for an organization
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.
get /orgs/{org}/actions/runnersParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runnersawait octokit.request('GET /orgs/{org}/actions/runners', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runnersResponse
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"
}
]
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
List runner applications for an organization
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.
get /orgs/{org}/actions/runners/downloadsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/downloadsawait octokit.request('GET /orgs/{org}/actions/runners/downloads', {
org: 'ORG'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/downloadsResponse
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"
}
]Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Create a registration token for an organization
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
post /orgs/{org}/actions/runners/registration-tokenParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/registration-tokenawait octokit.request('POST /orgs/{org}/actions/runners/registration-token', {
org: 'ORG'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/registration-tokenResponse
Status: 201{
"token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-22T12:13:35.123-08:00"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
Observações
Create a remove token for an organization
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
post /orgs/{org}/actions/runners/remove-tokenParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/remove-tokenawait octokit.request('POST /orgs/{org}/actions/runners/remove-token', {
org: 'ORG'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/remove-tokenResponse
Status: 201{
"token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-29T12:13:35.123-08:00"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
Observações
Get a self-hosted runner for an organization
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.
get /orgs/{org}/actions/runners/{runner_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_IDawait octokit.request('GET /orgs/{org}/actions/runners/{runner_id}', {
org: 'ORG',
runner_id: 'RUNNER_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/RUNNER_IDResponse
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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Delete a self-hosted runner from an organization
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.
delete /orgs/{org}/actions/runners/{runner_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_IDawait octokit.request('DELETE /orgs/{org}/actions/runners/{runner_id}', {
org: 'ORG',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/RUNNER_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
List labels for a self-hosted runner for an organization
Lists all labels for a self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
get /orgs/{org}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labelsawait octokit.request('GET /orgs/{org}/actions/runners/{runner_id}/labels', {
org: 'ORG',
runner_id: 'RUNNER_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/RUNNER_ID/labelsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
Observações
Add custom labels to a self-hosted runner for an organization
Add custom labels to a self-hosted runner configured in an organization.
You must authenticate using an access token with the admin:org scope to use this endpoint.
post /orgs/{org}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
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
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'await octokit.request('POST /orgs/{org}/actions/runners/{runner_id}/labels', {
org: 'ORG',
runner_id: 'RUNNER_ID',
labels: [
'gpu',
'accelerated'
]
})Response
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Observações
Set custom labels for a self-hosted runner for an organization
Remove all previous custom labels and set the new custom labels for 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.
put /orgs/{org}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'await octokit.request('PUT /orgs/{org}/actions/runners/{runner_id}/labels', {
org: 'ORG',
runner_id: 'RUNNER_ID',
labels: [
'gpu',
'accelerated'
]
})Response
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Observações
Remove all custom labels from a self-hosted runner for an organization
Remove all custom labels from a self-hosted runner configured in an organization. Returns the remaining read-only labels from the runner.
You must authenticate using an access token with the admin:org scope to use this endpoint.
delete /orgs/{org}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labelsawait octokit.request('DELETE /orgs/{org}/actions/runners/{runner_id}/labels', {
org: 'ORG',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/RUNNER_ID/labelsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
Observações
Remove a custom label from a self-hosted runner for an organization
Remove a custom label from a self-hosted runner configured in an organization. Returns the remaining labels from the runner.
This endpoint returns a 404 Not Found status if the custom label is not
present on the runner.
You must authenticate using an access token with the admin:org scope to use this endpoint.
delete /orgs/{org}/actions/runners/{runner_id}/labels/{name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
org | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
name | string | path | The name of a self-hosted runner's custom label. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/actions/runners/RUNNER_ID/labels/NAMEawait octokit.request('DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}', {
org: 'ORG',
runner_id: 'RUNNER_ID',
name: 'NAME'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/orgs/ORG/actions/runners/RUNNER_ID/labels/NAMEResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Observações
List self-hosted runners for a repository
Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the repo scope to use this endpoint.
get /repos/{owner}/{repo}/actions/runnersParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runnersawait octokit.request('GET /repos/{owner}/{repo}/actions/runners', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runnersResponse
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"
}
]
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
List runner applications for a repository
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.
get /repos/{owner}/{repo}/actions/runners/downloadsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/downloadsawait octokit.request('GET /repos/{owner}/{repo}/actions/runners/downloads', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/downloadsResponse
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"
}
]Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Create a registration token for a repository
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
post /repos/{owner}/{repo}/actions/runners/registration-tokenParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/registration-tokenawait octokit.request('POST /repos/{owner}/{repo}/actions/runners/registration-token', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/registration-tokenResponse
Status: 201{
"token": "LLBF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-22T12:13:35.123-08:00"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
Observações
Create a remove token for a repository
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
post /repos/{owner}/{repo}/actions/runners/remove-tokenParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/remove-tokenawait octokit.request('POST /repos/{owner}/{repo}/actions/runners/remove-token', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/remove-tokenResponse
Status: 201{
"token": "AABF3JGZDX3P5PMEXLND6TS6FCWO6",
"expires_at": "2020-01-29T12:13:35.123-08:00"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
Observações
Get a self-hosted runner for a repository
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.
get /repos/{owner}/{repo}/actions/runners/{runner_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_IDawait octokit.request('GET /repos/{owner}/{repo}/actions/runners/{runner_id}', {
owner: 'OWNER',
repo: 'REPO',
runner_id: 'RUNNER_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/RUNNER_IDResponse
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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Delete a self-hosted runner from a repository
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.
delete /repos/{owner}/{repo}/actions/runners/{runner_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_IDawait octokit.request('DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}', {
owner: 'OWNER',
repo: 'REPO',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/RUNNER_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
List labels for a self-hosted runner for a repository
Lists all labels for a self-hosted runner configured in a repository.
You must authenticate using an access token with the repo scope to use this
endpoint.
get /repos/{owner}/{repo}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labelsawait octokit.request('GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels', {
owner: 'OWNER',
repo: 'REPO',
runner_id: 'RUNNER_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/RUNNER_ID/labelsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
Observações
Add custom labels to a self-hosted runner for a repository
Add custom labels to a self-hosted runner configured in a repository.
You must authenticate using an access token with the repo scope to use this
endpoint.
post /repos/{owner}/{repo}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
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
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'await octokit.request('POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels', {
owner: 'OWNER',
repo: 'REPO',
runner_id: 'RUNNER_ID',
labels: [
'gpu',
'accelerated'
]
})Response
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Observações
Set custom labels for a self-hosted runner for a repository
Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in a repository.
You must authenticate using an access token with the repo scope to use this
endpoint.
put /repos/{owner}/{repo}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
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
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels \
-d '{"labels":["gpu","accelerated"]}'await octokit.request('PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels', {
owner: 'OWNER',
repo: 'REPO',
runner_id: 'RUNNER_ID',
labels: [
'gpu',
'accelerated'
]
})Response
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Observações
Remove all custom labels from a self-hosted runner for a repository
Remove all custom labels from a self-hosted runner configured in a repository. Returns the remaining read-only labels from the runner.
You must authenticate using an access token with the repo scope to use this
endpoint.
delete /repos/{owner}/{repo}/actions/runners/{runner_id}/labelsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labelsawait octokit.request('DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels', {
owner: 'OWNER',
repo: 'REPO',
runner_id: 'RUNNER_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/RUNNER_ID/labelsResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
Observações
Remove a custom label from a self-hosted runner for a repository
Remove a custom label from a self-hosted runner configured in a repository. Returns the remaining labels from the runner.
This endpoint returns a 404 Not Found status if the custom label is not
present on the runner.
You must authenticate using an access token with the repo scope to use this
endpoint.
delete /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
runner_id | integer | path | Unique identifier of the self-hosted runner. |
name | string | path | The name of a self-hosted runner's custom label. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels/NAMEawait octokit.request('DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}', {
owner: 'OWNER',
repo: 'REPO',
runner_id: 'RUNNER_ID',
name: 'NAME'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runners/RUNNER_ID/labels/NAMEResponse
Status: 200{
"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"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
422 | Validation failed |
Observações
Trabalhos de fluxo de trabalho
A API de Trabalhos de Fluxo de Trabalho permite que você visualize logs e trabalhos de fluxo de trabalho. A tarefa de um fluxo de trabalho é um conjunto de etapas que são realizadas no mesmo executor. Para obter mais informações, consulte "Sintaxe de fluxo de trabalho para GitHub Actions".
Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub deve ter a permissão de ações para usar essa API.
Get a job for a workflow run
Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/jobs/{job_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
job_id | integer | path | job_id parameter |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/jobs/JOB_IDawait octokit.request('GET /repos/{owner}/{repo}/actions/jobs/{job_id}', {
owner: 'OWNER',
repo: 'REPO',
job_id: 'JOB_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/jobs/JOB_IDResponse
Status: 200{
"id": 399444496,
"run_id": 29679449,
"run_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449",
"node_id": "MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==",
"head_sha": "f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0",
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
"html_url": "https://github.com/octo-org/octo-repo/runs/399444496",
"status": "completed",
"conclusion": "success",
"started_at": "2020-01-20T17:42:40Z",
"completed_at": "2020-01-20T17:44:39Z",
"name": "build",
"steps": [
{
"name": "Set up job",
"status": "completed",
"conclusion": "success",
"number": 1,
"started_at": "2020-01-20T09:42:40.000-08:00",
"completed_at": "2020-01-20T09:42:41.000-08:00"
},
{
"name": "Run actions/checkout@v2",
"status": "completed",
"conclusion": "success",
"number": 2,
"started_at": "2020-01-20T09:42:41.000-08:00",
"completed_at": "2020-01-20T09:42:45.000-08:00"
},
{
"name": "Set up Ruby",
"status": "completed",
"conclusion": "success",
"number": 3,
"started_at": "2020-01-20T09:42:45.000-08:00",
"completed_at": "2020-01-20T09:42:45.000-08:00"
},
{
"name": "Run actions/cache@v3",
"status": "completed",
"conclusion": "success",
"number": 4,
"started_at": "2020-01-20T09:42:45.000-08:00",
"completed_at": "2020-01-20T09:42:48.000-08:00"
},
{
"name": "Install Bundler",
"status": "completed",
"conclusion": "success",
"number": 5,
"started_at": "2020-01-20T09:42:48.000-08:00",
"completed_at": "2020-01-20T09:42:52.000-08:00"
},
{
"name": "Install Gems",
"status": "completed",
"conclusion": "success",
"number": 6,
"started_at": "2020-01-20T09:42:52.000-08:00",
"completed_at": "2020-01-20T09:42:53.000-08:00"
},
{
"name": "Run Tests",
"status": "completed",
"conclusion": "success",
"number": 7,
"started_at": "2020-01-20T09:42:53.000-08:00",
"completed_at": "2020-01-20T09:42:59.000-08:00"
},
{
"name": "Deploy to Heroku",
"status": "completed",
"conclusion": "success",
"number": 8,
"started_at": "2020-01-20T09:42:59.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
},
{
"name": "Post actions/cache@v3",
"status": "completed",
"conclusion": "success",
"number": 16,
"started_at": "2020-01-20T09:44:39.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
},
{
"name": "Complete job",
"status": "completed",
"conclusion": "success",
"number": 17,
"started_at": "2020-01-20T09:44:39.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
}
],
"check_run_url": "https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496",
"labels": [
"self-hosted",
"foo",
"bar"
],
"runner_id": 1,
"runner_name": "my runner",
"runner_group_id": 2,
"runner_group_name": "my runner group"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Download job logs for a workflow run
Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look
for Location: in the response header to find the URL for the download. Anyone with read access to the repository can
use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must
have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/jobs/{job_id}/logsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
job_id | integer | path | job_id parameter |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/jobs/JOB_ID/logsawait octokit.request('GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs', {
owner: 'OWNER',
repo: 'REPO',
job_id: 'JOB_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/jobs/JOB_ID/logsResponse
Status: 302Status codes
| HTTP Status Code | Descrição |
|---|---|
302 | Found |
Observações
List jobs for a workflow run attempt
Lists jobs for a specific workflow run attempt. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
get /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
attempt_number | integer | path | The attempt number of the workflow run. |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/attempts/ATTEMPT_NUMBER/jobsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID',
attempt_number: 'ATTEMPT_NUMBER'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/attempts/ATTEMPT_NUMBER/jobsResponse
Status: 200{
"total_count": 1,
"jobs": [
{
"id": 399444496,
"run_id": 29679449,
"run_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449",
"node_id": "MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==",
"head_sha": "f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0",
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
"html_url": "https://github.com/octo-org/octo-repo/runs/399444496",
"status": "completed",
"conclusion": "success",
"started_at": "2020-01-20T17:42:40Z",
"completed_at": "2020-01-20T17:44:39Z",
"name": "build",
"steps": [
{
"name": "Set up job",
"status": "completed",
"conclusion": "success",
"number": 1,
"started_at": "2020-01-20T09:42:40.000-08:00",
"completed_at": "2020-01-20T09:42:41.000-08:00"
},
{
"name": "Run actions/checkout@v2",
"status": "completed",
"conclusion": "success",
"number": 2,
"started_at": "2020-01-20T09:42:41.000-08:00",
"completed_at": "2020-01-20T09:42:45.000-08:00"
},
{
"name": "Set up Ruby",
"status": "completed",
"conclusion": "success",
"number": 3,
"started_at": "2020-01-20T09:42:45.000-08:00",
"completed_at": "2020-01-20T09:42:45.000-08:00"
},
{
"name": "Run actions/cache@v3",
"status": "completed",
"conclusion": "success",
"number": 4,
"started_at": "2020-01-20T09:42:45.000-08:00",
"completed_at": "2020-01-20T09:42:48.000-08:00"
},
{
"name": "Install Bundler",
"status": "completed",
"conclusion": "success",
"number": 5,
"started_at": "2020-01-20T09:42:48.000-08:00",
"completed_at": "2020-01-20T09:42:52.000-08:00"
},
{
"name": "Install Gems",
"status": "completed",
"conclusion": "success",
"number": 6,
"started_at": "2020-01-20T09:42:52.000-08:00",
"completed_at": "2020-01-20T09:42:53.000-08:00"
},
{
"name": "Run Tests",
"status": "completed",
"conclusion": "success",
"number": 7,
"started_at": "2020-01-20T09:42:53.000-08:00",
"completed_at": "2020-01-20T09:42:59.000-08:00"
},
{
"name": "Deploy to Heroku",
"status": "completed",
"conclusion": "success",
"number": 8,
"started_at": "2020-01-20T09:42:59.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
},
{
"name": "Post actions/cache@v3",
"status": "completed",
"conclusion": "success",
"number": 16,
"started_at": "2020-01-20T09:44:39.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
},
{
"name": "Complete job",
"status": "completed",
"conclusion": "success",
"number": 17,
"started_at": "2020-01-20T09:44:39.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
}
],
"check_run_url": "https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496",
"labels": [
"self-hosted",
"foo",
"bar"
],
"runner_id": 1,
"runner_name": "my runner",
"runner_group_id": 2,
"runner_group_name": "my runner group"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
404 | Resource not found |
Observações
List jobs for a workflow run
Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
get /repos/{owner}/{repo}/actions/runs/{run_id}/jobsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
filter | string | query | Filters jobs by their Padrão: |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/jobsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/jobsResponse
Status: 200{
"total_count": 1,
"jobs": [
{
"id": 399444496,
"run_id": 29679449,
"run_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/29679449",
"node_id": "MDEyOldvcmtmbG93IEpvYjM5OTQ0NDQ5Ng==",
"head_sha": "f83a356604ae3c5d03e1b46ef4d1ca77d64a90b0",
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/jobs/399444496",
"html_url": "https://github.com/octo-org/octo-repo/runs/399444496",
"status": "completed",
"conclusion": "success",
"started_at": "2020-01-20T17:42:40Z",
"completed_at": "2020-01-20T17:44:39Z",
"name": "build",
"steps": [
{
"name": "Set up job",
"status": "completed",
"conclusion": "success",
"number": 1,
"started_at": "2020-01-20T09:42:40.000-08:00",
"completed_at": "2020-01-20T09:42:41.000-08:00"
},
{
"name": "Run actions/checkout@v2",
"status": "completed",
"conclusion": "success",
"number": 2,
"started_at": "2020-01-20T09:42:41.000-08:00",
"completed_at": "2020-01-20T09:42:45.000-08:00"
},
{
"name": "Set up Ruby",
"status": "completed",
"conclusion": "success",
"number": 3,
"started_at": "2020-01-20T09:42:45.000-08:00",
"completed_at": "2020-01-20T09:42:45.000-08:00"
},
{
"name": "Run actions/cache@v3",
"status": "completed",
"conclusion": "success",
"number": 4,
"started_at": "2020-01-20T09:42:45.000-08:00",
"completed_at": "2020-01-20T09:42:48.000-08:00"
},
{
"name": "Install Bundler",
"status": "completed",
"conclusion": "success",
"number": 5,
"started_at": "2020-01-20T09:42:48.000-08:00",
"completed_at": "2020-01-20T09:42:52.000-08:00"
},
{
"name": "Install Gems",
"status": "completed",
"conclusion": "success",
"number": 6,
"started_at": "2020-01-20T09:42:52.000-08:00",
"completed_at": "2020-01-20T09:42:53.000-08:00"
},
{
"name": "Run Tests",
"status": "completed",
"conclusion": "success",
"number": 7,
"started_at": "2020-01-20T09:42:53.000-08:00",
"completed_at": "2020-01-20T09:42:59.000-08:00"
},
{
"name": "Deploy to Heroku",
"status": "completed",
"conclusion": "success",
"number": 8,
"started_at": "2020-01-20T09:42:59.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
},
{
"name": "Post actions/cache@v3",
"status": "completed",
"conclusion": "success",
"number": 16,
"started_at": "2020-01-20T09:44:39.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
},
{
"name": "Complete job",
"status": "completed",
"conclusion": "success",
"number": 17,
"started_at": "2020-01-20T09:44:39.000-08:00",
"completed_at": "2020-01-20T09:44:39.000-08:00"
}
],
"check_run_url": "https://api.github.com/repos/octo-org/octo-repo/check-runs/399444496",
"labels": [
"self-hosted",
"foo",
"bar"
],
"runner_id": 1,
"runner_name": "my runner",
"runner_group_id": 2,
"runner_group_name": "my runner group"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Workflow runs
The Workflow Runs API allows you to view, re-run, cancel, and view logs for workflow runs. A execução de um fluxo de trabalho é uma instância do seu fluxo de trabalho que é executado quando ocorre um evento pré-configurado. For more information, see "Managing a workflow run."
Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub deve ter a permissão de ações para usar essa API.
Re-run a job from a workflow run
Re-run a job and its dependent jobs in a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
post /repos/{owner}/{repo}/actions/jobs/{job_id}/rerunParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
job_id | integer | path | job_id parameter |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/jobs/JOB_ID/rerunawait octokit.request('POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun', {
owner: 'OWNER',
repo: 'REPO',
job_id: 'JOB_ID'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/jobs/JOB_ID/rerunResponse
Status: 201Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
403 | Forbidden |
Observações
List workflow runs for a repository
Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
actor | string | query | Returns someone's workflow runs. Use the login for the user who created the |
branch | string | query | Returns workflow runs associated with a branch. Use the name of the branch of the |
event | string | query | Returns workflow run triggered by the event you specify. For example, |
status | string | query | Returns workflow runs with the check run |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
created | string | query | Returns workflow runs created within the given date-time range. For more information on the syntax, see "Understanding the search syntax." |
exclude_pull_requests | boolean | query | If |
check_suite_id | integer | query | Returns workflow runs with the |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runsResponse
Status: 200{
"total_count": 1,
"workflow_runs": [
{
"id": 30433642,
"name": "Build",
"node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
"check_suite_id": 42,
"check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
"head_branch": "master",
"head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
"run_number": 562,
"event": "push",
"status": "queued",
"conclusion": null,
"workflow_id": 159038,
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
"html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
"pull_requests": [],
"created_at": "2020-01-22T19:33:08Z",
"updated_at": "2020-01-22T19:33:08Z",
"actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"run_attempt": 1,
"run_started_at": "2020-01-22T19:33:08Z",
"triggering_actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
"logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
"check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
"artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
"cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
"rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
"workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
"head_commit": {
"id": "acb5820ced9479c074f688cc328bf03f341a511d",
"tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
"message": "Create linter.yaml",
"timestamp": "2020-01-22T19:33:05Z",
"author": {
"name": "Octo Cat",
"email": "octocat@github.com"
},
"committer": {
"name": "GitHub",
"email": "noreply@github.com"
}
},
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
},
"head_repository": {
"id": 217723378,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
"name": "octo-repo",
"full_name": "octo-org/octo-repo",
"private": true,
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/octo-org/octo-repo",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/octo-org/octo-repo",
"forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
"keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
"hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
"issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
"events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
"assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
"branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
"tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
"blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
"stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
"contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
"subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
"subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
"commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
"compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
"archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
"issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
"pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
}
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get a workflow run
Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
exclude_pull_requests | boolean | query | If |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_IDawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_IDResponse
Status: 200{
"id": 30433642,
"name": "Build",
"node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
"check_suite_id": 42,
"check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
"head_branch": "master",
"head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
"run_number": 562,
"event": "push",
"status": "queued",
"conclusion": null,
"workflow_id": 159038,
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
"html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
"pull_requests": [],
"created_at": "2020-01-22T19:33:08Z",
"updated_at": "2020-01-22T19:33:08Z",
"actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"run_attempt": 1,
"run_started_at": "2020-01-22T19:33:08Z",
"triggering_actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
"logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
"check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
"artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
"cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
"rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
"workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
"head_commit": {
"id": "acb5820ced9479c074f688cc328bf03f341a511d",
"tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
"message": "Create linter.yaml",
"timestamp": "2020-01-22T19:33:05Z",
"author": {
"name": "Octo Cat",
"email": "octocat@github.com"
},
"committer": {
"name": "GitHub",
"email": "noreply@github.com"
}
},
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
},
"head_repository": {
"id": 217723378,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
"name": "octo-repo",
"full_name": "octo-org/octo-repo",
"private": true,
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/octo-org/octo-repo",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/octo-org/octo-repo",
"forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
"keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
"hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
"issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
"events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
"assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
"branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
"tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
"blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
"stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
"contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
"subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
"subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
"commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
"compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
"archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
"issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
"pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
}
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Delete a workflow run
Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is
private you must use an access token with the repo scope. GitHub Apps must have the actions:write permission to use
this endpoint.
delete /repos/{owner}/{repo}/actions/runs/{run_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_IDawait octokit.request('DELETE /repos/{owner}/{repo}/actions/runs/{run_id}', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_IDResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Get the review history for a workflow run
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}/approvalsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/approvalsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/approvalsResponse
Status: 200[
{
"state": "approved",
"comment": "Ship it!",
"environments": [
{
"id": 161088068,
"node_id": "MDExOkVudmlyb25tZW50MTYxMDg4MDY4",
"name": "staging",
"url": "https://api.github.com/repos/github/hello-world/environments/staging",
"html_url": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging",
"created_at": "2020-11-23T22:00:40Z",
"updated_at": "2020-11-23T22:00:40Z"
}
],
"user": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
}
]Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Approve a workflow run for a fork pull request
Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see "Approving workflow runs from public forks."
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
post /repos/{owner}/{repo}/actions/runs/{run_id}/approveParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/approveawait octokit.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/approveResponse
Status: 201Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
403 | Forbidden |
404 | Resource not found |
Observações
Get a workflow run attempt
Gets a specific workflow run attempt. Anyone with read access to the repository
can use this endpoint. If the repository is private you must use an access token
with the repo scope. GitHub Apps must have the actions:read permission to
use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
attempt_number | integer | path | The attempt number of the workflow run. |
exclude_pull_requests | boolean | query | If |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/attempts/ATTEMPT_NUMBERawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID',
attempt_number: 'ATTEMPT_NUMBER'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/attempts/ATTEMPT_NUMBERResponse
Status: 200{
"id": 30433642,
"name": "Build",
"node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
"check_suite_id": 42,
"check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
"head_branch": "master",
"head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
"run_number": 562,
"event": "push",
"status": "queued",
"conclusion": null,
"workflow_id": 159038,
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
"html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
"pull_requests": [],
"created_at": "2020-01-22T19:33:08Z",
"updated_at": "2020-01-22T19:33:08Z",
"actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"run_attempt": 1,
"run_started_at": "2020-01-22T19:33:08Z",
"triggering_actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
"logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
"check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
"artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
"cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
"rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
"workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
"head_commit": {
"id": "acb5820ced9479c074f688cc328bf03f341a511d",
"tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
"message": "Create linter.yaml",
"timestamp": "2020-01-22T19:33:05Z",
"author": {
"name": "Octo Cat",
"email": "octocat@github.com"
},
"committer": {
"name": "GitHub",
"email": "noreply@github.com"
}
},
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
},
"head_repository": {
"id": 217723378,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
"name": "octo-repo",
"full_name": "octo-org/octo-repo",
"private": true,
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/octo-org/octo-repo",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/octo-org/octo-repo",
"forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
"keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
"hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
"issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
"events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
"assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
"branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
"tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
"blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
"stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
"contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
"subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
"subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
"commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
"compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
"archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
"issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
"pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
}
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Download workflow run attempt logs
Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after
1 minute. Look for Location: in the response header to find the URL for the download. Anyone with read access to
the repository can use this endpoint. If the repository is private you must use an access token with the repo scope.
GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
attempt_number | integer | path | The attempt number of the workflow run. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/attempts/ATTEMPT_NUMBER/logsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID',
attempt_number: 'ATTEMPT_NUMBER'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/attempts/ATTEMPT_NUMBER/logsResponse
Status: 302Status codes
| HTTP Status Code | Descrição |
|---|---|
302 | Found |
Observações
Cancel a workflow run
Cancels a workflow run using its id. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
post /repos/{owner}/{repo}/actions/runs/{run_id}/cancelParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/cancelawait octokit.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/cancelResponse
Status: 202Status codes
| HTTP Status Code | Descrição |
|---|---|
202 | Accepted |
409 | Conflict |
Observações
Download workflow run logs
Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for
Location: in the response header to find the URL for the download. Anyone with read access to the repository can use
this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have
the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}/logsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/logsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/logsResponse
Status: 302Status codes
| HTTP Status Code | Descrição |
|---|---|
302 | Found |
Observações
Delete workflow run logs
Deletes all logs for a workflow run. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
delete /repos/{owner}/{repo}/actions/runs/{run_id}/logsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/logsawait octokit.request('DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/logsResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
403 | Forbidden |
500 | Internal Error |
Observações
Get pending deployments for a workflow run
Get all deployment environments for a workflow run that are waiting for protection rules to pass.
Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deploymentsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/pending_deploymentsawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/pending_deploymentsResponse
Status: 200[
{
"environment": {
"id": 161088068,
"node_id": "MDExOkVudmlyb25tZW50MTYxMDg4MDY4",
"name": "staging",
"url": "https://api.github.com/repos/github/hello-world/environments/staging",
"html_url": "https://github.com/github/hello-world/deployments/activity_log?environments_filter=staging"
},
"wait_timer": 30,
"wait_timer_started_at": "2020-11-23T22:00:40Z",
"current_user_can_approve": true,
"reviewers": [
{
"type": "User",
"reviewer": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
},
{
"type": "Team",
"reviewer": {
"id": 1,
"node_id": "MDQ6VGVhbTE=",
"url": "https://api.github.com/teams/1",
"html_url": "https://github.com/orgs/github/teams/justice-league",
"name": "Justice League",
"slug": "justice-league",
"description": "A great team.",
"privacy": "closed",
"permission": "admin",
"members_url": "https://api.github.com/teams/1/members{/member}",
"repositories_url": "https://api.github.com/teams/1/repos",
"parent": null
}
}
]
}
]Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Review pending deployments for a workflow run
Approve or reject pending deployments that are waiting on approval by a required reviewer.
Anyone with read access to the repository contents and deployments can use this endpoint.
post /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deploymentsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
environment_ids | array of integers | body | Required. The list of environment ids to approve or reject |
state | string | body | Required. Whether to approve or reject deployment to the specified environments. Must be one of: |
comment | string | body | Required. A comment to accompany the deployment review |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/pending_deploymentsawait octokit.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/pending_deploymentsResponse
Status: 200[
{
"url": "https://api.github.com/repos/octocat/example/deployments/1",
"id": 1,
"node_id": "MDEwOkRlcGxveW1lbnQx",
"sha": "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d",
"ref": "topic-branch",
"task": "deploy",
"payload": {},
"original_environment": "staging",
"environment": "production",
"description": "Deploy request from hubot",
"creator": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2012-07-20T01:19:13Z",
"updated_at": "2012-07-20T01:19:13Z",
"statuses_url": "https://api.github.com/repos/octocat/example/deployments/1/statuses",
"repository_url": "https://api.github.com/repos/octocat/example",
"transient_environment": false,
"production_environment": true
}
]Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Re-run a workflow
Re-runs your workflow run using its id. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
post /repos/{owner}/{repo}/actions/runs/{run_id}/rerunParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/rerunawait octokit.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/rerunResponse
Status: 201Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
Re-run failed jobs from a workflow run
Re-run all of the failed jobs and their dependent jobs in a workflow run using the id of the workflow run. You must authenticate using an access token with the repo scope to use this endpoint.
post /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/rerun-failed-jobsawait octokit.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/rerun-failed-jobsResponse
Status: 201Status codes
| HTTP Status Code | Descrição |
|---|---|
201 | Created |
Observações
Get workflow run usage
Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. 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".
Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/runs/{run_id}/timingParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
run_id | integer | path | The id of the workflow run. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/runs/RUN_ID/timingawait octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing', {
owner: 'OWNER',
repo: 'REPO',
run_id: 'RUN_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/runs/RUN_ID/timingResponse
Status: 200{
"billable": {
"UBUNTU": {
"total_ms": 180000,
"jobs": 1,
"job_runs": [
{
"job_id": 1,
"duration_ms": 180000
}
]
},
"MACOS": {
"total_ms": 240000,
"jobs": 4,
"job_runs": [
{
"job_id": 2,
"duration_ms": 60000
},
{
"job_id": 3,
"duration_ms": 60000
},
{
"job_id": 4,
"duration_ms": 60000
},
{
"job_id": 5,
"duration_ms": 60000
}
]
},
"WINDOWS": {
"total_ms": 300000,
"jobs": 2,
"job_runs": [
{
"job_id": 6,
"duration_ms": 150000
},
{
"job_id": 7,
"duration_ms": 150000
}
]
}
},
"run_duration_ms": 500000
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
List workflow runs
List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.
Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope.
get /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
workflow_id | path | The ID of the workflow. You can also pass the workflow file name as a string. | |
actor | string | query | Returns someone's workflow runs. Use the login for the user who created the |
branch | string | query | Returns workflow runs associated with a branch. Use the name of the branch of the |
event | string | query | Returns workflow run triggered by the event you specify. For example, |
status | string | query | Returns workflow runs with the check run |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
created | string | query | Returns workflow runs created within the given date-time range. For more information on the syntax, see "Understanding the search syntax." |
exclude_pull_requests | boolean | query | If |
check_suite_id | integer | query | Returns workflow runs with the |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/runsawait octokit.request('GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs', {
owner: 'OWNER',
repo: 'REPO',
workflow_id: 'WORKFLOW_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/runsResponse
Status: 200{
"total_count": 1,
"workflow_runs": [
{
"id": 30433642,
"name": "Build",
"node_id": "MDEyOldvcmtmbG93IFJ1bjI2OTI4OQ==",
"check_suite_id": 42,
"check_suite_node_id": "MDEwOkNoZWNrU3VpdGU0Mg==",
"head_branch": "master",
"head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
"run_number": 562,
"event": "push",
"status": "queued",
"conclusion": null,
"workflow_id": 159038,
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642",
"html_url": "https://github.com/octo-org/octo-repo/actions/runs/30433642",
"pull_requests": [],
"created_at": "2020-01-22T19:33:08Z",
"updated_at": "2020-01-22T19:33:08Z",
"actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"run_attempt": 1,
"run_started_at": "2020-01-22T19:33:08Z",
"triggering_actor": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"jobs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/jobs",
"logs_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/logs",
"check_suite_url": "https://api.github.com/repos/octo-org/octo-repo/check-suites/414944374",
"artifacts_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/artifacts",
"cancel_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/cancel",
"rerun_url": "https://api.github.com/repos/octo-org/octo-repo/actions/runs/30433642/rerun",
"workflow_url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/159038",
"head_commit": {
"id": "acb5820ced9479c074f688cc328bf03f341a511d",
"tree_id": "d23f6eedb1e1b9610bbc754ddb5197bfe7271223",
"message": "Create linter.yaml",
"timestamp": "2020-01-22T19:33:05Z",
"author": {
"name": "Octo Cat",
"email": "octocat@github.com"
},
"committer": {
"name": "GitHub",
"email": "noreply@github.com"
}
},
"repository": {
"id": 1296269,
"node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"name": "Hello-World",
"full_name": "octocat/Hello-World",
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"private": false,
"html_url": "https://github.com/octocat/Hello-World",
"description": "This your first repo!",
"fork": false,
"url": "https://api.github.com/repos/octocat/Hello-World",
"archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}",
"assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}",
"blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}",
"branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}",
"collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}",
"commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}",
"compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}",
"contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors",
"deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments",
"downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads",
"events_url": "https://api.github.com/repos/octocat/Hello-World/events",
"forks_url": "https://api.github.com/repos/octocat/Hello-World/forks",
"git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}",
"git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}",
"git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}",
"git_url": "git:github.com/octocat/Hello-World.git",
"issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}",
"issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}",
"issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}",
"keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}",
"languages_url": "https://api.github.com/repos/octocat/Hello-World/languages",
"merges_url": "https://api.github.com/repos/octocat/Hello-World/merges",
"milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}",
"pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}",
"releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}",
"ssh_url": "git@github.com:octocat/Hello-World.git",
"stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers",
"statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}",
"subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers",
"subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription",
"tags_url": "https://api.github.com/repos/octocat/Hello-World/tags",
"teams_url": "https://api.github.com/repos/octocat/Hello-World/teams",
"trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}",
"hooks_url": "http://api.github.com/repos/octocat/Hello-World/hooks"
},
"head_repository": {
"id": 217723378,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTc3MjMzNzg=",
"name": "octo-repo",
"full_name": "octo-org/octo-repo",
"private": true,
"owner": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/octo-org/octo-repo",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/octo-org/octo-repo",
"forks_url": "https://api.github.com/repos/octo-org/octo-repo/forks",
"keys_url": "https://api.github.com/repos/octo-org/octo-repo/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/octo-org/octo-repo/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/octo-org/octo-repo/teams",
"hooks_url": "https://api.github.com/repos/octo-org/octo-repo/hooks",
"issue_events_url": "https://api.github.com/repos/octo-org/octo-repo/issues/events{/number}",
"events_url": "https://api.github.com/repos/octo-org/octo-repo/events",
"assignees_url": "https://api.github.com/repos/octo-org/octo-repo/assignees{/user}",
"branches_url": "https://api.github.com/repos/octo-org/octo-repo/branches{/branch}",
"tags_url": "https://api.github.com/repos/octo-org/octo-repo/tags",
"blobs_url": "https://api.github.com/repos/octo-org/octo-repo/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/octo-org/octo-repo/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/octo-org/octo-repo/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/octo-org/octo-repo/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/octo-org/octo-repo/statuses/{sha}",
"languages_url": "https://api.github.com/repos/octo-org/octo-repo/languages",
"stargazers_url": "https://api.github.com/repos/octo-org/octo-repo/stargazers",
"contributors_url": "https://api.github.com/repos/octo-org/octo-repo/contributors",
"subscribers_url": "https://api.github.com/repos/octo-org/octo-repo/subscribers",
"subscription_url": "https://api.github.com/repos/octo-org/octo-repo/subscription",
"commits_url": "https://api.github.com/repos/octo-org/octo-repo/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/octo-org/octo-repo/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/octo-org/octo-repo/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/octo-org/octo-repo/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/octo-org/octo-repo/contents/{+path}",
"compare_url": "https://api.github.com/repos/octo-org/octo-repo/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/octo-org/octo-repo/merges",
"archive_url": "https://api.github.com/repos/octo-org/octo-repo/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/octo-org/octo-repo/downloads",
"issues_url": "https://api.github.com/repos/octo-org/octo-repo/issues{/number}",
"pulls_url": "https://api.github.com/repos/octo-org/octo-repo/pulls{/number}",
"milestones_url": "https://api.github.com/repos/octo-org/octo-repo/milestones{/number}",
"notifications_url": "https://api.github.com/repos/octo-org/octo-repo/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/octo-org/octo-repo/labels{/name}",
"releases_url": "https://api.github.com/repos/octo-org/octo-repo/releases{/id}",
"deployments_url": "https://api.github.com/repos/octo-org/octo-repo/deployments"
}
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Fluxos de trabalho
A API de fluxos de trabalho permite que você veja fluxos de trabalho para um repositório. Com os fluxos de trabalho, você pode automatizar o ciclo de vida de desenvolvimento de software usando várias ferramentas e serviços. Para obter mais informações, consulte "Automatizando seu fluxo de trabalho com o GitHub Actions".
Esta API está disponível para usuários autenticados, Aplicativos OAuth e Aplicativos do GitHub. Os tokens de acesso exigem o escopo repositório para repositórios privados e escopo public_repo para públicos. Aplicativos do GitHub deve ter a permissão de ações para usar essa API.
List repository workflows
Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/workflowsParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
per_page | integer | query | Results per page (max 100) Padrão: |
page | integer | query | Page number of the results to fetch. Padrão: |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/workflowsawait octokit.request('GET /repos/{owner}/{repo}/actions/workflows', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/workflowsResponse
Status: 200{
"total_count": 2,
"workflows": [
{
"id": 161335,
"node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
"name": "CI",
"path": ".github/workflows/blank.yaml",
"state": "active",
"created_at": "2020-01-08T23:48:37.000-08:00",
"updated_at": "2020-01-08T23:50:21.000-08:00",
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335",
"html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335",
"badge_url": "https://github.com/octo-org/octo-repo/workflows/CI/badge.svg"
},
{
"id": 269289,
"node_id": "MDE4OldvcmtmbG93IFNlY29uZGFyeTI2OTI4OQ==",
"name": "Linter",
"path": ".github/workflows/linter.yaml",
"state": "active",
"created_at": "2020-01-08T23:48:37.000-08:00",
"updated_at": "2020-01-08T23:50:21.000-08:00",
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/269289",
"html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/269289",
"badge_url": "https://github.com/octo-org/octo-repo/workflows/Linter/badge.svg"
}
]
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Get a workflow
Gets a specific workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/workflows/{workflow_id}Parâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
workflow_id | path | The ID of the workflow. You can also pass the workflow file name as a string. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/workflows/WORKFLOW_IDawait octokit.request('GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}', {
owner: 'OWNER',
repo: 'REPO',
workflow_id: 'WORKFLOW_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/workflows/WORKFLOW_IDResponse
Status: 200{
"id": 161335,
"node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
"name": "CI",
"path": ".github/workflows/blank.yaml",
"state": "active",
"created_at": "2020-01-08T23:48:37.000-08:00",
"updated_at": "2020-01-08T23:50:21.000-08:00",
"url": "https://api.github.com/repos/octo-org/octo-repo/actions/workflows/161335",
"html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335",
"badge_url": "https://github.com/octo-org/octo-repo/workflows/CI/badge.svg"
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |
Observações
Disable a workflow
Disables a workflow and sets the state of the workflow to disabled_manually. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
put /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disableParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
workflow_id | path | The ID of the workflow. You can also pass the workflow file name as a string. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/disableawait octokit.request('PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable', {
owner: 'OWNER',
repo: 'REPO',
workflow_id: 'WORKFLOW_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/disableResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Create a workflow dispatch event
You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.
You must configure your GitHub Actions workflow to run when the workflow_dispatch webhook event occurs. The inputs are configured in the workflow file. For more information about how to configure the workflow_dispatch event in the workflow file, see "Events that trigger workflows."
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. For more information, see "Creating a personal access token for the command line."
post /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatchesParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
workflow_id | path | The ID of the workflow. You can also pass the workflow file name as a string. | |
ref | string | body | Required. The git reference for the workflow. The reference can be a branch or tag name. |
inputs | object | body | Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when |
Amostras de código
Example
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/dispatches \
-d '{"ref":"topic-branch","inputs":{"name":"Mona the Octocat","home":"San Francisco, CA"}}'await octokit.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', {
owner: 'OWNER',
repo: 'REPO',
workflow_id: 'WORKFLOW_ID',
ref: 'topic-branch',
inputs: {
name: 'Mona the Octocat',
home: 'San Francisco, CA'
}
})Response
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Enable a workflow
Enables a workflow and sets the state of the workflow to active. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.
You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.
put /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enableParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
workflow_id | path | The ID of the workflow. You can also pass the workflow file name as a string. |
Amostras de código
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/enableawait octokit.request('PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable', {
owner: 'OWNER',
repo: 'REPO',
workflow_id: 'WORKFLOW_ID'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/enableResponse
Status: 204Status codes
| HTTP Status Code | Descrição |
|---|---|
204 | No Content |
Observações
Get workflow usage
Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. 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".
You can replace workflow_id with the workflow file name. For example, you could use main.yaml. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.
get /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timingParâmetros
| Nome | Tipo | In | Descrição |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path | |
workflow_id | path | The ID of the workflow. You can also pass the workflow file name as a string. |
Amostras de código
Example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/timingawait octokit.request('GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing', {
owner: 'OWNER',
repo: 'REPO',
workflow_id: 'WORKFLOW_ID'
})gh api \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/timingResponse
Status: 200{
"billable": {
"UBUNTU": {
"total_ms": 180000
},
"MACOS": {
"total_ms": 240000
},
"WINDOWS": {
"total_ms": 300000
}
}
}Status codes
| HTTP Status Code | Descrição |
|---|---|
200 | OK |