-
Notifications
You must be signed in to change notification settings - Fork 30
/
action.yaml
70 lines (68 loc) · 2.64 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: 'Container Retention Policy'
description: 'Define a retention policy for your GHCR-hosted container images'
branding:
icon: "book"
color: "blue"
inputs:
account:
description: "Should be 'user' for personal accounts and the organization name for organizations."
required: true
token:
description: "GitHub access token used to authenticate towards the GitHub packages APIs."
required: true
cut-off:
description: "The cut-off for which to delete images older than. For example '2d' for 2 days."
required: true
image-names:
description: "List of package names to consider."
required: true
image-tags:
description: "List of package version names to consider."
required: false
skip-shas:
description: "Package version SHAs to not delete."
required: false
default: ''
tag-selection:
description: "Specify whether to consider tagged images, untagged images, or both."
required: false
default: 'both'
keep-n-most-recent:
description: 'How many image versions to always retain. Newer package versions are prioritized.'
required: false
default: '0'
timestamp-to-use:
description: 'Whether to use `updated_at` or `created_at` timestamps when considering the cut-off.'
required: false
default: 'updated_at'
dry-run:
description: "Do not actually delete images. Instead, print which images would have been deleted to the console."
required: false
default: 'false'
rust-log:
description: "Lets you specify a log level or a list of log levels for the different Rust crates used by the action."
required: false
default: 'container_retention_policy=INFO'
outputs:
deleted:
description: 'Comma-separated list of image names and tags, for image versions that were deleted during the run.'
value: ${{ steps.container-retention-policy.outputs.deleted }}
failed:
description: 'Comma-separated list of image names and tags, for image versions that we failed to delete during the run, for an unknown reason.'
value: ${{ steps.container-retention-policy.outputs.failed }}
runs:
using: 'docker'
image: 'docker://ghcr.io/snok/container-retention-policy:v3.0.0'
args:
- --account=${{ inputs.account }}
- --token=${{ inputs.token }}
- --image-names=${{ inputs.image-names }}
- --image-tags=${{ inputs.image-tags }}
- --shas-to-skip=${{ inputs.skip-shas }}
- --tag-selection=${{ inputs.tag-selection }}
- --keep-n-most-recent=${{ inputs.keep-n-most-recent }}
- --timestamp-to-use=${{ inputs.timestamp-to-use }}
- --cut-off=${{ inputs.cut-off }}
- --dry-run=${{ inputs.dry-run }}
env:
RUST_LOG: ${{ inputs.rust-log }}