Standardize macOS app update queries and related automation (#39164)
This pull request updates the logic used to check whether macOS applications (1Password, Firefox, and Slack) are up to date. The new queries simplify and improve accuracy by directly identifying outdated app versions, rather than relying on a combination of existence and version checks. **Policy query logic updates:** * Updated the query in `update-1password.yml` to directly select hosts with outdated 1Password versions, making the check more precise. * Updated the query in `update-firefox.yml` to directly select hosts with outdated Firefox versions, improving accuracy. * Updated the query in `update-slack.yml` to directly select hosts with outdated Slack versions, ensuring more reliable detection. **Script logic update:** * Changed the query line construction in `.github/scripts/dogfood-policy-updater-latest-1password-macos.sh` to match the new logic for identifying outdated 1Password installations.
This commit is contained in:
@@ -54,7 +54,7 @@ if [ "$policy_version_number" != "$latest_1password_macos_version" ]; then
|
||||
echo "Updating query line with the new version..."
|
||||
|
||||
# Prepare the new query line
|
||||
new_query_line="query: SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE name = '1Password.app') OR EXISTS (SELECT 1 FROM apps WHERE name = '1Password.app' AND version_compare(bundle_short_version, '$latest_1password_macos_version') >= 0);"
|
||||
new_query_line="query: SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE name = '1Password.app' AND version_compare(bundle_short_version, '$latest_1password_macos_version') < 0);"
|
||||
|
||||
# Update the response
|
||||
updated_response=$(echo "$response" | sed "s/query: .*/$new_query_line/")
|
||||
|
||||
Reference in New Issue
Block a user