From 74138471e3c4801ce302719e775c6c819efef635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=CC=84nis=20Baiz=CC=8Ca?= Date: Mon, 2 Mar 2026 21:37:15 +0200 Subject: [PATCH] Set HOME variable from OS information --- dist/index.js | 7 +++++-- index.js | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 704b9da..dba1be0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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\ - 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') } diff --git a/index.js b/index.js index 7fdcf5b..fc8bbe6 100644 --- a/index.js +++ b/index.js @@ -219,8 +219,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\ - 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') }