Skip to main content

cache_usage

Creates, updates, deletes, gets or lists a cache_usage resource.

Overview

Namecache_usage
TypeResource
Idgithub.actions.cache_usage

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
full_namestringThe repository owner and name for the cache usage being shown. (example: octo-org/Hello-World)
active_caches_countintegerThe number of active caches in the repository.
active_caches_size_in_bytesintegerThe sum of the size in bytes of all the active cache items in the repository.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_actions_cache_usageselectowner, repoGets 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_orgselectorgGets 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.

NameDatatypeDescription
orgstringThe organization name. The name is not case sensitive.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.

SELECT examples

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
;