Skip to main content

artifact_log_retention

Creates, updates, deletes, gets or lists an artifact_log_retention resource.

Overview

Nameartifact_log_retention
TypeResource
Idgithub.actions.artifact_log_retention

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
daysintegerThe number of days artifacts and logs are retained
maximum_allowed_daysintegerThe maximum number of days that can be configured

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_artifact_and_log_retention_settings_repositoryselectowner, repoGets artifact and log retention settings for a repository.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
get_artifact_and_log_retention_settings_organizationselectorgGets artifact and log retention settings for an organization.

OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission to use this endpoint.
set_artifact_and_log_retention_settings_repositoryreplaceowner, repo, daysSets artifact and log retention settings for a repository.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
set_artifact_and_log_retention_settings_organizationreplaceorg, daysSets artifact and log retention settings for an organization.

OAuth app tokens and personal access tokens (classic) need the admin:org scope or the "Actions policies" fine-grained permission 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 artifact and log retention settings for a repository.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

SELECT
days,
maximum_allowed_days
FROM github.actions.artifact_log_retention
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;

REPLACE examples

Sets artifact and log retention settings for a repository.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

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