Cache do GitHub Actions
A API do cache do GitHub Actions permite que você consulte e gerencie o cache GitHub Actions para repositórios.
About a API do cache
A API do cache do GitHub Actions permite que você consulte e gerencie o cache GitHub Actions para repositórios. 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.
Parâmetros
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
enterprisestringObrigatórioThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: <TOKEN>" \
https://api.github.com/enterprises/ENTERPRISE/actions/cache/usageResponse
Status: 200{
"total_active_caches_size_in_bytes": 3344284,
"total_active_caches_count": 5
}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.
Parâmetros
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
orgstringObrigatórioThe organization name. The name is not case sensitive. |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: <TOKEN>" \
https://api.github.com/orgs/ORG/actions/cache/usageResponse
Status: 200{
"total_active_caches_size_in_bytes": 3344284,
"total_active_caches_count": 5
}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.
Parâmetros
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
orgstringObrigatórioThe organization name. The name is not case sensitive. |
| Parâmetros de consulta |
| Nome, Tipo, Descrição |
per_pageintegerThe number of results per page (max 100). Padrão: |
pageintegerPage number of the results to fetch. Padrão: |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: <TOKEN>" \
https://api.github.com/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
}
]
}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.
Parâmetros
| Headers |
|---|
| Nome, Tipo, Descrição |
acceptstringSetting to |
| Path parameters |
| Nome, Tipo, Descrição |
ownerstringObrigatórioThe account owner of the repository. The name is not case sensitive. |
repostringObrigatórioThe name of the repository. The name is not case sensitive. |
HTTP response status codes
| Status code | Descrição |
|---|---|
200 | OK |
Amostras de código
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: <TOKEN>" \
https://api.github.com/repos/OWNER/REPO/actions/cache/usageResponse
Status: 200{
"full_name": "octo-org/Hello-World",
"active_caches_size_in_bytes": 2322142,
"active_caches_count": 3
}