From 4075c048cad14feace870c8af5fca2f6ae5ee724 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Fri, 10 Oct 2025 23:46:30 -0300 Subject: [PATCH] chore: limpar builds antigos com sudo --- .github/workflows/ci-cd-web-desktop.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-web-desktop.yml b/.github/workflows/ci-cd-web-desktop.yml index 6894276..84aaa73 100644 --- a/.github/workflows/ci-cd-web-desktop.yml +++ b/.github/workflows/ci-cd-web-desktop.yml @@ -236,7 +236,11 @@ jobs: - name: Cleanup old build workdirs (keep last 3) run: | - ls -1dt $HOME/apps/sistema.build.* 2>/dev/null | tail -n +4 | xargs -r rm -rf || true + set -e + find "$HOME/apps" -maxdepth 1 -type d -name 'sistema.build.*' | sort -r | tail -n +4 | while read dir; do + echo "Removing $dir" + sudo rm -rf "$dir" + done || true - name: Restart web service with new code run: |