Skip to main content

cache_retention_limit

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

Overview

Namecache_retention_limit
TypeResource
Idgithub.actions.cache_retention_limit

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
max_cache_retention_daysintegerThe maximum number of days to keep caches in this repository.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_actions_cache_retention_limit_for_repositoryselectowner, repoGets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if
not manually removed or evicted due to size constraints.

OAuth tokens and personal access tokens (classic) need the admin:repository scope to use this endpoint.
get_actions_cache_retention_limit_for_enterpriseselectenterpriseGets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this
enterprise may not set a higher cache retention limit.

OAuth tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.
get_actions_cache_retention_limit_for_organizationselectorgGets GitHub Actions cache retention limit for an organization. All repositories under this
organization may not set a higher cache retention limit.

OAuth tokens and personal access tokens (classic) need the admin:organization scope to use this endpoint.
set_actions_cache_retention_limit_for_repositoryreplaceowner, repoSets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if
not manually removed or evicted due to size constraints.

OAuth tokens and personal access tokens (classic) need the admin:repository scope to use this endpoint.
set_actions_cache_retention_limit_for_enterprisereplaceenterpriseSets GitHub Actions cache retention limit for an enterprise. All organizations and repositories under this
enterprise may not set a higher cache retention limit.

OAuth tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.
set_actions_cache_retention_limit_for_organizationreplaceorgSets GitHub Actions cache retention limit for an organization. All repositories under this
organization may not set a higher cache retention limit.

OAuth tokens and personal access tokens (classic) need the admin:organization 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
enterprisestringThe slug version of the enterprise name.
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 retention limit for a repository. This determines how long caches will be retained for, if
not manually removed or evicted due to size constraints.

OAuth tokens and personal access tokens (classic) need the admin:repository scope to use this endpoint.

SELECT
max_cache_retention_days
FROM github.actions.cache_retention_limit
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;

REPLACE examples

Sets GitHub Actions cache retention limit for a repository. This determines how long caches will be retained for, if
not manually removed or evicted due to size constraints.

OAuth tokens and personal access tokens (classic) need the admin:repository scope to use this endpoint.

REPLACE github.actions.cache_retention_limit
SET
max_cache_retention_days = {{ max_cache_retention_days }}
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required;