ci(windows): trust git ownership; flutter SDK was provisioned by a different user
build-windows / build-windows-x64 (push) Failing after 1h2m24s

This commit is contained in:
2026-05-05 07:23:09 +02:00
parent b19f8b59ba
commit ba3851f875
+12
View File
@@ -148,6 +148,18 @@ jobs:
Write-Host "`n== git --version =="
git --version
# Diagnose the real reason flutter pub get says "Unable to find git in
# your PATH". On a self-hosted runner where the Flutter SDK at
# C:\tools\flutter was provisioned by a different user, git refuses to
# touch it with "fatal: detected dubious ownership". Flutter's tool
# catches that ProcessException and (misleadingly) reports it as a
# missing-git-on-PATH error.
Write-Host "`n== git ops on flutter SDK (probe for dubious ownership) =="
git -C 'C:\tools\flutter' rev-parse HEAD 2>&1 | Out-Host
Write-Host "`n== Configuring safe.directory globally for runner user =="
git config --global --add safe.directory '*'
git config --global --get-all safe.directory
# Workaround: stage git.exe next to dart.exe. CreateProcessW searches
# the calling exe's directory before PATH -- so dropping git.exe here
# bypasses any PATH oddities the dart child may inherit from its