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 Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/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
Exampleselected_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
Examplegenerated
{ "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>
Examplegenerated
{ "message": "example", "documentation_url": "example", "detail": "example", "status": 1, "scimType": "example", "schemas": [ "example" ]}Forbidden
Media typeapplication/json
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Examplegenerated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Resource not found
Media typeapplication/json
Basic Error
Basic Error
object
message
string
documentation_url
string
url
string
status
string
Examplegenerated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}