diff --git a/.github/actions/free-disk-space/action.yml b/.github/actions/free-disk-space/action.yml index a20f2bd5ae3..c3b7e450d28 100644 --- a/.github/actions/free-disk-space/action.yml +++ b/.github/actions/free-disk-space/action.yml @@ -7,6 +7,11 @@ runs: steps: - shell: bash run: | + avail=$(df --output=avail -BG / | tr -dc '0-9') + if [ "$avail" -ge 50 ]; then + echo "skipping cleanup, ${avail}G free" + exit 0 + fi echo "free space before cleanup:" df -h / for dir in /usr/local/lib/android /usr/local/.ghcup /opt/ghc /usr/share/dotnet; do