Commit 6cdb8bf0a29 for php.net
commit 6cdb8bf0a29921f8a5630f72d885dcf9c5a450b6
Author: Ilija Tovilo <ilija.tovilo@me.com>
Date: Sat Dec 13 20:27:14 2025 +0100
Fix xcode-select
The old Xcode sticks around, so make sure we sort in reverse to pick the newer
version. Technically we should use something like sort -Vr, but -V doesn't exist
on macOS. But that won't be a problem until Xcode 100, which my great great
grand children can worry about.
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."