Set GitHub Actions cache retention limit for a repository
PUT
/repos/{owner}/{repo}/actions/cache/retention-limit
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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” owner
required
string
The account owner of the repository. The name is not case sensitive.
repo
required
string
The name of the repository without the .git extension. The name is not case sensitive.
Request Body required
Section titled “ Request Body required ” Media type application/json
Actions cache retention limit for a repository
GitHub Actions cache retention policy for a repository.
object
max_cache_retention_days
The maximum number of days to keep caches in this repository.
integer
Examples
Example selected_actions
{ "max_cache_retention_days": 80}Responses
Section titled “ Responses ”Response
Bad Request
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"} Scim Error
Scim Error
object
message
string
documentation_url
string
detail
string
status
integer
scimType
string
schemas
Array<string>
Example generated
{ "message": "example", "documentation_url": "example", "detail": "example", "status": 1, "scimType": "example", "schemas": [ "example" ]}Forbidden
Media type application/json
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Resource not found
Media type application/json
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}