fix(repo-identity): use native realpath on Windows to resolve 8.3 short paths (#1960)

Use realpathSync.native() on Windows in canonicalizeExistingPath to resolve
8.3 short names (RUNNER~1 → runneradmin). Fixes isInheritedRepo path
comparison failures on Windows CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
TÂCHES 2026-03-21 21:08:58 -06:00 committed by GitHub
parent 09f3a5f970
commit d40ed851a2

View file

@ -164,7 +164,8 @@ function getRemoteUrl(basePath: string): string {
*/
function canonicalizeExistingPath(path: string): string {
try {
return realpathSync(path);
// Use native realpath on Windows to resolve 8.3 short paths (e.g. RUNNER~1)
return process.platform === "win32" ? realpathSync.native(path) : realpathSync(path);
} catch {
return resolve(path);
}