-
Notifications
You must be signed in to change notification settings - Fork 8
Disable Windows Defender real-time scanning during Behat runs #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,16 @@ jobs: | |
| WP_CLI_TEST_OBJECT_CACHE: ${{ inputs.object_cache }} | ||
|
|
||
| steps: | ||
| # The Behat suite spawns a large number of short-lived `wp`/`php` | ||
| # processes and writes many files per scenario. On the Windows runner, | ||
| # Defender's real-time scanning inspects each of these, which slows the | ||
| # run down by several times compared to Linux. Turning it off for the | ||
| # duration of this ephemeral job cuts the wall-clock time dramatically. | ||
| - name: Disable Windows Defender real-time scanning | ||
| if: ${{ startsWith(inputs.os, 'windows') }} | ||
| shell: pwsh | ||
| run: Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue | ||
|
Comment on lines
+59
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== relevant snippet ==="
sed -n '1,140p' .github/workflows/reusable-functional.yml
echo
echo "=== search for Set-MpPreference and Defender mentions ==="
rg -n "Set-MpPreference|Defender|RealtimeMonitoring|ErrorAction SilentlyContinue" .github/workflows . -g '!**/node_modules/**' -g '!**/.git/**'Repository: wp-cli/.github Length of output: 6148 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,140p' .github/workflows/reusable-functional.yml
printf '\n---\n'
rg -n "Set-MpPreference|Defender|RealtimeMonitoring|ErrorAction SilentlyContinue" .github/workflows . -g '!**/node_modules/**' -g '!**/.git/**'Repository: wp-cli/.github Length of output: 6069 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,140p' .github/workflows/reusable-functional.yml
printf '\n---\n'
rg -n "Set-MpPreference|Defender|RealtimeMonitoring|ErrorAction SilentlyContinue" .github/workflows . -g '!**/node_modules/**' -g '!**/.git/**'Repository: wp-cli/.github Length of output: 6069 Surface Defender-disable failures 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Check out source code | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: wp-cli/.github
Length of output: 8320
🏁 Script executed:
Repository: wp-cli/.github
Length of output: 516
Avoid disabling Defender globally for the entire job.
This runs before checkout and dependency installation, so all later repo, Composer, and test code executes with real-time scanning off. Use a narrower workspace/process exclusion, or re-enable it in an
always()cleanup step if this has to stay.🤖 Prompt for AI Agents