From 8adc84699e75d92c6982deccbef2ec24b4dda6bb Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Fri, 12 Jun 2026 04:12:15 +0530 Subject: [PATCH] fix: keep only 2 SHA tags (current + 1 previous) to save disk space --- .forgejo/workflows/build.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 440e87b..41545cc 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -267,7 +267,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Cleanup old image tags (after all builds complete) + - name: Cleanup old image tags (keep running + 1 previous) continue-on-error: true env: REGISTRY_HOST: ${{ secrets.REGISTRY_HOSTPORT }} @@ -277,6 +277,7 @@ jobs: run: | set -euo pipefail echo "Starting post-build cleanup for services: $SERVICES_CSV" + echo "Policy: Keep only 2 SHA tags (running + 1 previous)" IFS=',' read -ra SERVICES <<< "$SERVICES_CSV" for service in "${SERVICES[@]}"; do @@ -286,7 +287,7 @@ jobs: --repo "nxtgauge-rust-$service" \ --username "$REGISTRY_USERNAME" \ --password "$REGISTRY_PASSWORD" \ - --keep 3 || echo "Warning: Failed to prune $service (continuing)" + --keep 2 || echo "Warning: Failed to prune $service (continuing)" done - echo "Post-build cleanup completed" + echo "Post-build cleanup completed - only 2 most recent SHA tags kept"