diff --git a/.gitea/workflows/build-windows.yml b/.gitea/workflows/build-windows.yml index 594bcf88c..eca62319d 100644 --- a/.gitea/workflows/build-windows.yml +++ b/.gitea/workflows/build-windows.yml @@ -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