cache_retention_limit
Creates, updates, deletes, gets or lists a cache_retention_limit resource.
Overview
| Name | cache_retention_limit |
| Type | Resource |
| Id | github.actions.cache_retention_limit |
Fields
The following fields are returned by SELECT queries:
- get_actions_cache_retention_limit_for_repository
- get_actions_cache_retention_limit_for_enterprise
- get_actions_cache_retention_limit_for_organization
Response
| Name | Datatype | Description |
|---|---|---|
max_cache_retention_days | integer | The maximum number of days to keep caches in this repository. |
Response
| Name | Datatype | Description |
|---|---|---|
max_cache_retention_days | integer | For repositories & organizations in an enterprise, the maximum duration, in days, for which caches in a repository may be retained. |
Response
| Name | Datatype | Description |
|---|---|---|
max_cache_retention_days | integer | For repositories in this organization, the maximum duration, in days, for which caches in a repository may be retained. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_actions_cache_retention_limit_for_repository | select | owner, repo | 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. | |
get_actions_cache_retention_limit_for_enterprise | select | enterprise | Gets 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_organization | select | org | Gets 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_repository | replace | owner, repo | 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. | |
set_actions_cache_retention_limit_for_enterprise | replace | enterprise | Sets 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_organization | replace | org | Sets 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.
| Name | Datatype | Description |
|---|---|---|
enterprise | string | The slug version of the enterprise name. |
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_retention_limit_for_repository
- get_actions_cache_retention_limit_for_enterprise
- get_actions_cache_retention_limit_for_organization
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
;
Gets 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.
SELECT
max_cache_retention_days
FROM github.actions.cache_retention_limit
WHERE enterprise = '{{ enterprise }}' -- required
;
Gets 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.
SELECT
max_cache_retention_days
FROM github.actions.cache_retention_limit
WHERE org = '{{ org }}' -- required
;
REPLACE examples
- set_actions_cache_retention_limit_for_repository
- set_actions_cache_retention_limit_for_enterprise
- set_actions_cache_retention_limit_for_organization
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;
Sets 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.
REPLACE github.actions.cache_retention_limit
SET
max_cache_retention_days = {{ max_cache_retention_days }}
WHERE
enterprise = '{{ enterprise }}' --required;
Sets 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.
REPLACE github.actions.cache_retention_limit
SET
max_cache_retention_days = {{ max_cache_retention_days }}
WHERE
org = '{{ org }}' --required;