forked from Chizkiyahu/delete-untagged-ghcr-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
68 lines (59 loc) · 1.98 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
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
name: 'Delete untagged ghcr'
author: 'Chuzkiyahu Raful'
description: 'Delete containers on github container registry without tags'
branding:
icon: 'trash-2'
color: 'blue'
inputs:
token:
description: >
Personal access token (PAT) used to fetch the repository. The PAT is configured
with the local git config, which enables your scripts to run authenticated git
commands. The post-job step removes the PAT.
needs delete:packages permissions
required: true
repository_owner:
description: 'The repository owner name'
default: ${{ github.repository_owner }}
required: true
repository:
description: 'Delete only from repository name'
required: false
package_name:
description: 'Delete only from package name'
required: false
untagged_only:
description: 'Delete only package versions without tag'
default: true
except_untagged_multiplatform:
description: 'Except untagged multiplatform packages from deletion (only for --untagged_only)'
default: false
owner_type:
description : "Owner type (org or user)"
required: true
runs:
using: "composite"
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- run: pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- run: |
args="--token ${{ inputs.token }} "
args+=" --repository_owner ${{ inputs.repository_owner }} "
if [[ $repo ]]; then
args+=" --repository $repo "
fi
if [[ $pkg ]]; then
args+=" --package_name $pkg "
fi
args+=" --untagged_only ${{ inputs.untagged_only }} "
args+=" --except_untagged_multiplatform ${{ inputs.except_untagged_multiplatform }} "
args+=" --owner_type ${{ inputs.owner_type }} "
echo "args: $args"
python ${{ github.action_path }}/clean_ghcr.py $args
shell: bash
env:
repo: ${{ inputs.repository }}
pkg: ${{ inputs.package_name }}