From 8ce97df569f313d5a28ad702ead71bd2be648873 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 1 Dec 2025 17:32:46 -0800 Subject: [PATCH] build: gate brew commands in free-space-macos action (#49123) fix: gate brew commands in free-space-macos action The brew uninstall and autoremove commands now only run if brew is available on the machine. This prevents failures on runners where Homebrew is not installed. Co-authored-by: Claude --- .github/actions/free-space-macos/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/free-space-macos/action.yml b/.github/actions/free-space-macos/action.yml index 33ed9f835d..11ca7633a9 100644 --- a/.github/actions/free-space-macos/action.yml +++ b/.github/actions/free-space-macos/action.yml @@ -80,8 +80,10 @@ runs: sudo rm -rf /Users/runner/.rustup # remove homebrew packages we don't need - brew uninstall -f --zap aws-sam-cli session-manager-plugin gcc gcc@13 gcc@14 llvm@18 gradle maven ant azure-cli - brew autoremove + if command -v brew &> /dev/null; then + brew uninstall -f --zap aws-sam-cli session-manager-plugin gcc gcc@13 gcc@14 llvm@18 gradle maven ant azure-cli + brew autoremove + fi # lipo off some huge binaries arm64 versions to save space strip_universal_deep $(xcode-select -p)/../SharedFrameworks