diff --git a/.github/actions/macos-update-clang/action.yml b/.github/actions/macos-update-clang/action.yml index bceb431aed5..916b4dfe41f 100644 --- a/.github/actions/macos-update-clang/action.yml +++ b/.github/actions/macos-update-clang/action.yml @@ -8,7 +8,7 @@ runs: label=$((softwareupdate -l 2>/dev/null | grep 'Label:' | grep -o 'Command Line Tools for Xcode.*' | head -1) || echo '') if [ -n "$label" ]; then softwareupdate -i "$label" - xcode_path=$(ls -1 '/Applications' | grep 'Xcode_.*\.app' | head -1) + xcode_path=$(ls -1 '/Applications' | grep 'Xcode_.*\.app' | sort -r | head -1) sudo xcode-select -s "/Applications/$xcode_path" else echo "Not found."