From e9060ddab8af3e2d780cb6765a8c14c375478495 Mon Sep 17 00:00:00 2001 From: alexanderM91 Date: Thu, 17 Oct 2024 12:31:29 +0200 Subject: [PATCH] Automatic (outdated) images cleanup --- .github/workflows/cleanup-old-docker-images.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cleanup-old-docker-images.yml b/.github/workflows/cleanup-old-docker-images.yml index f38c63cd..a78db190 100644 --- a/.github/workflows/cleanup-old-docker-images.yml +++ b/.github/workflows/cleanup-old-docker-images.yml @@ -2,7 +2,7 @@ name: Cleanup Old Docker Images > 6 months by the scheduler on: schedule: - - cron: '0 11 * * *' # Schedule to run at 11:00 UTC every day + - cron: '0 11 * * *' push: branches-ignore: - master @@ -44,7 +44,9 @@ jobs: if [[ ${AGE} -ge ${THRESHOLD} ]] && [[ ${TAG_NAME} =~ ${HASH_PATTERN} ]]; then echo "Deleting image tag ${TAG_NAME} (last updated: ${LAST_UPDATED})" - - # Uncomment the following lines to enable image deletion fi + + if [[ ${IMAGES_DELETED} == false ]]; then + echo "No images matching the pattern were found for deletion." + fi done