mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Mac OS] Fix logic for retrying AppleScript execution (#8662)
This commit is contained in:
committed by
GitHub
parent
a9d78d7787
commit
a84b44268a
@@ -36,16 +36,20 @@ fi
|
|||||||
# System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now
|
# System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now
|
||||||
if is_Monterey; then
|
if is_Monterey; then
|
||||||
if is_Veertu; then
|
if is_Veertu; then
|
||||||
echo "Executing AppleScript to change security preferences (with retries)"
|
for retry in {4..0}; do
|
||||||
retry=5
|
echo "Executing AppleScript to change security preferences. Retries left: $retry"
|
||||||
while [ $retry -gt 0 ]; do
|
|
||||||
{
|
{
|
||||||
|
set -e
|
||||||
osascript -e 'tell application "System Events" to get application processes where visible is true'
|
osascript -e 'tell application "System Events" to get application processes where visible is true'
|
||||||
}
|
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
|
||||||
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
|
} && break
|
||||||
|
|
||||||
retry=$((retry-1))
|
if [ "$retry" -eq 0 ]; then
|
||||||
echo "retries left "$retry
|
echo "Executing AppleScript failed. No retries left"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Executing AppleScript failed. Sleeping for 10 seconds and retrying"
|
||||||
sleep 10
|
sleep 10
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user