diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index de51759..ba0343e 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -213,13 +213,21 @@ jobs: set -x # Enable debug output # List and remove any running containers first echo "=== Removing running containers ===" - podman --remote ps -aq | while read -r container; do - echo "Removing container: $container" - podman --remote rm -f "$container" || echo "Failed to remove container $container" - done + containers=$(podman --remote ps -aq) + if [ -n "$containers" ]; then + echo "Found containers: $containers" + for container in $containers; do + echo "Attempting to remove container: $container" + # Try to stop first, then remove + podman --remote stop "$container" 2>/dev/null || true + podman --remote rm -f "$container" 2>/dev/null || echo "Warning: Could not remove container $container" + done + else + echo "No containers found to remove" + fi echo "=== Pruning system ===" - podman --remote system prune -f + podman --remote system prune -f || echo "Pruning completed with warnings" echo "=== Storage status after pruning ===" podman --remote system df