Repository navigation
release-desktop: skip the Defender scan when Defender is unavailable - #8059
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Treat an unavailable Defender as "no scan happened" and skip, instead of failing the release. A Defender that is present but misconfigured still fails closed, and an actual detection still fails the job. Nothing about the detection path changes.
Why
Two consecutive
Build Windows (x64)attempts on run 31117717223 failed atScan Windows bundles with Defenderduring the 2026-08-06 Actions incident. Neither failure was a detection. The runners came up with the Defender WMI provider dead and the service RPC endpoint down:Get-MpComputerStatusandGet-MpPreferencethrew, so$statusand$prefwere null. Every downstream check then read a null as a misconfiguration (RealTimeProtectionEnabled=false,MAPSReporting=<empty>) and the gate failed closed. The Windows app itself built and signed successfully both times.The gate was doing the right thing with the information it had, but it could not tell "Defender says this is bad" from "there is no Defender here". Those deserve different outcomes.
What changed
Get-MpComputerStatus/Get-MpPreferenceare now read throughtry/catchwith-ErrorAction Stop. If either throws or yields nothing, the step emits a warning naming the failure and exits 0 without scanning.The trigger is deliberately narrow: only the cmdlets themselves failing, which means the engine is not answering at all. Anything that can still produce a verdict keeps the old behaviour.
The warning states plainly that the bundles were not scanned, so a skip is never mistaken for a clean result in the log.
Behaviour matrix
Checks
release-desktop.ymlparses as YAML.run:script parses with 0 errors via[System.Management.Automation.Language.Parser].Tradeoff
This accepts an unscanned Windows bundle when the runner's scanner is broken, rather than blocking the release. That is a deliberate loosening of a supply-chain gate. The alternative, waiting for a healthy runner, is unbounded when the degradation is fleet-wide, as it was here. The signing path is untouched, so bundles remain signed and
Verify every executable in the Windows bundles is signedstill runs.