Set HOME variable from OS information

This commit is contained in:
Jānis Baiža
2026-03-06 13:30:33 +00:00
committed by Benoit Daloze
parent b3cff1b264
commit 74138471e3
2 changed files with 10 additions and 4 deletions
Generated Vendored
+5 -2
View File
@@ -92706,8 +92706,11 @@ function envPreInstall() {
if (windows) {
// puts normal Ruby temp folder on SSD
core.exportVariable('TMPDIR', ENV['RUNNER_TEMP'])
// bash - sets home to match native windows, normally C:\Users\<user name>
core.exportVariable('HOME', ENV['HOMEDRIVE'] + ENV['HOMEPATH'])
// Use os.homedir() which calls the Windows API (SHGetFolderPath) directly.
// Env-based approaches (USERPROFILE, HOMEDRIVE+HOMEPATH) are unreliable on some
// runners (e.g. Blacksmith) where these vars are unset, causing NaN which
// JSON.stringify serializes to "null".
core.exportVariable('HOME', os.homedir())
// bash - needed to maintain Path from Windows
core.exportVariable('MSYS2_PATH_TYPE', 'inherit')
}