File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,15 @@ docker image ls --format "{{.Size}} {{.ID}} {{.Repository}} {{.Tag}}" | LANG=en_
6
6
image=$( echo " $line " | cut -d' ' -f2 )
7
7
repository=$( echo " $line " | cut -d' ' -f3 )
8
8
tag=$( echo " $line " | cut -d' ' -f4 )
9
- if [ " $tag " != " <none>" ]; then
10
- if [ " $size " -gt 200000000 ]; then
11
- echo " Cleaning $image $repository :$size "
12
- docker image rm $image
13
- fi
9
+ if [[ " $tag " =~ ^[a-f0-9]{32}$ ]]; then
10
+ echo " Ignoring GitHub action image $image $repository :$tag "
11
+ elif [[ " $tag " == " <none>" ]]; then
12
+ echo " Ignoring untagged image $image $repository :$tag "
13
+ elif [[ " $size " -lt 200000000 ]]; then
14
+ echo " Ignoring small image $image $repository :$tag "
15
+ else
16
+ echo " Cleaning $image $repository :$tag "
17
+ docker image rm $image
14
18
fi
15
19
done
16
20
You can’t perform that action at this time.
0 commit comments