From a585f51404f273f25d7bc1ef4c2179a1624c13e5 Mon Sep 17 00:00:00 2001
From: Dmitry Shibanov <shibanov-1997@inbox.ru>
Date: Thu, 22 Jun 2023 12:21:37 +0200
Subject: [PATCH] use temp dir

---
 dist/setup/index.js | 2 +-
 src/installer.ts    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dist/setup/index.js b/dist/setup/index.js
index 0dcd234..520293e 100644
--- a/dist/setup/index.js
+++ b/dist/setup/index.js
@@ -61445,7 +61445,7 @@ function installGoVersion(info, auth, arch) {
         core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
         // Windows requires that we keep the extension (.zip) for extraction
         const isWindows = os_1.default.platform() === 'win32';
-        const tempDir = process.env.RUNNER_TEMP || '.';
+        const tempDir = os_1.default.tmpdir(); // process.env.RUNNER_TEMP || '.';
         const fileName = isWindows ? path.join(tempDir, info.fileName) : undefined;
         const downloadPath = yield tc.downloadTool(info.downloadUrl, fileName, auth);
         core.info('Extracting Go...');
diff --git a/src/installer.ts b/src/installer.ts
index 013fb64..f2fc255 100644
--- a/src/installer.ts
+++ b/src/installer.ts
@@ -173,7 +173,7 @@ async function installGoVersion(
 
   // Windows requires that we keep the extension (.zip) for extraction
   const isWindows = os.platform() === 'win32';
-  const tempDir = process.env.RUNNER_TEMP || '.';
+  const tempDir = os.tmpdir(); // process.env.RUNNER_TEMP || '.';
   const fileName = isWindows ? path.join(tempDir, info.fileName) : undefined;
 
   const downloadPath = await tc.downloadTool(info.downloadUrl, fileName, auth);