-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
37 lines (36 loc) · 1.19 KB
/
action.yml
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
name: "DigitalOcean Registry Cleanup Action"
description: "Deletes tags from a DigitalOcean container registry based on age and count criteria"
author: "Mrugesh Mohapatra"
branding:
icon: "trash"
color: "red"
inputs:
repository_name:
description: "Name of the DigitalOcean container registry repository"
required: true
dry_run:
description: "If true, shows what would be deleted without making any changes"
required: false
default: "false"
days:
description: "Delete tags older than these many days"
required: false
default: "2"
bypass_safety:
description: "Bypass the safety check that prevents deletion when no recent images exist"
required: false
default: "false"
keep_last:
description: "Number of most recent tags to keep, regardless of age"
required: false
runs:
using: "composite"
steps:
- run: |
$GITHUB_ACTION_PATH/entrypoint.sh \
${{ inputs.dry_run == 'true' && '-d' || '' }} \
-n ${{ inputs.days }} \
${{ inputs.bypass_safety == 'true' && '-b' || '' }} \
${{ inputs.keep_last && format('--keep-last {0}', inputs.keep_last) || '' }} \
${{ inputs.repository_name }}
shell: bash