diff --git a/cleanup-disk/action.yml b/cleanup-disk/action.yml index 4a1417e..4c58e3d 100644 --- a/cleanup-disk/action.yml +++ b/cleanup-disk/action.yml @@ -2,7 +2,7 @@ name: "Disk Space Cleanup" author: "Ultralytics" -description: "Cleans up disk space by removing unnecessary tool caches and packages" +description: "Cleans up disk space by removing unnecessary tool caches and swap space" runs: using: "composite" steps: @@ -11,7 +11,15 @@ runs: run: | echo "Free space before deletion:" df -h / + # Remove tool cache to free up ~15GB of space per https://github.com/ultralytics/ultralytics/pull/15848 rm -rf /opt/hostedtoolcache || true + + # Remove swap space to free up ~4GB + if [ -f /swapfile ]; then + sudo swapoff -a + sudo rm -f /swapfile + fi + echo "Free space after deletion:" df -h /