Skip to content

Commit c4ebecd

Browse files
committed
ci(pm): make defender setup best effort
1 parent 90a5182 commit c4ebecd

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/pm-ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ jobs:
5656
- name: Disable Windows Defender
5757
if: runner.os == 'Windows'
5858
shell: powershell
59-
run: Set-MpPreference -DisableRealtimeMonitoring $true
59+
run: |
60+
try {
61+
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction Stop
62+
} catch {
63+
Write-Warning "Unable to disable Windows Defender real-time monitoring: $_"
64+
}
6065
6166
# Add: Configure Git longpaths on Windows
6267
- name: Configure Git (Windows)

.github/workflows/pm-e2e-bench.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,12 @@ jobs:
254254
- uses: actions/checkout@v4
255255
- name: Disable Windows Defender
256256
shell: powershell
257-
run: Set-MpPreference -DisableRealtimeMonitoring $true
257+
run: |
258+
try {
259+
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction Stop
260+
} catch {
261+
Write-Warning "Unable to disable Windows Defender real-time monitoring: $_"
262+
}
258263
- name: Init git submodules
259264
run: git submodule update --init --recursive --depth 1
260265
- name: Setup Rust toolchain
@@ -408,7 +413,12 @@ jobs:
408413
- uses: actions/checkout@v4
409414
- name: Disable Windows Defender
410415
shell: powershell
411-
run: Set-MpPreference -DisableRealtimeMonitoring $true
416+
run: |
417+
try {
418+
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction Stop
419+
} catch {
420+
Write-Warning "Unable to disable Windows Defender real-time monitoring: $_"
421+
}
412422
- name: Setup node
413423
uses: actions/setup-node@v4
414424
with:

0 commit comments

Comments
 (0)