cache_usage
Creates, updates, deletes, gets or lists a cache_usage resource.
Overview
| Name | cache_usage |
| Type | Resource |
| Id | github.actions.cache_usage |
Fields
The following fields are returned by SELECT queries:
- get_actions_cache_usage
- get_actions_cache_usage_for_org
Response
| Name | Datatype | Description |
|---|---|---|
full_name | string | The repository owner and name for the cache usage being shown. (example: octo-org/Hello-World) |
active_caches_count | integer | The number of active caches in the repository. |
active_caches_size_in_bytes | integer | The sum of the size in bytes of all the active cache items in the repository. |
Response
| Name | Datatype | Description |
|---|---|---|
total_active_caches_count | integer | The count of active caches across all repositories of an enterprise or an organization. |
total_active_caches_size_in_bytes | integer | The total size in bytes of all active cache items across all repositories of an enterprise or an organization. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_actions_cache_usage | select | owner, repo | 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, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
get_actions_cache_usage_for_org | select | org | 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. OAuth tokens and personal access tokens (classic) need the read:org scope to use this endpoint. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
org | string | The organization name. The name is not case sensitive. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
SELECT examples
- get_actions_cache_usage
- get_actions_cache_usage_for_org
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, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
full_name,
active_caches_count,
active_caches_size_in_bytes
FROM github.actions.cache_usage
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;
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.
OAuth tokens and personal access tokens (classic) need the read:org scope to use this endpoint.
SELECT
total_active_caches_count,
total_active_caches_size_in_bytes
FROM github.actions.cache_usage
WHERE org = '{{ org }}' -- required
;