snok/Container Retention Policy
Define a retention policy for your GHCR-hosted container images
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| account | Should be 'user' for personal accounts and the organization name for organizations. | yes | — |
| token | GitHub access token used to authenticate towards the GitHub packages APIs. | yes | — |
| cut-off | The cut-off for which to delete images older than. For example '2d' for 2 days. | yes | — |
| image-names | List of package names to consider. | yes | — |
| image-tags | List of package version names to consider. | no | — |
| skip-shas | Package version SHAs to not delete. | no | "" |
| tag-selection | Specify whether to consider tagged images, untagged images, or both. | no | both |
| keep-n-most-recent | How many image versions to always retain. Newer package versions are prioritized. | no | 0 |
| timestamp-to-use | Whether to use `updated_at` or `created_at` timestamps when considering the cut-off. | no | updated_at |
| dry-run | Do not actually delete images. Instead, print which images would have been deleted to the console. | no | false |
| rust-log | Lets you specify a log level or a list of log levels for the different Rust crates used by the action. | no | container_retention_policy=INFO |
Outputs
| name | description |
|---|---|
| deleted | Comma-separated list of image names and tags, for image versions that were deleted during the run. |
| failed | Comma-separated list of image names and tags, for image versions that we failed to delete during the run, for an unknown reason. |