From f087628d597c4b105fa054baae6aab2097e4caed Mon Sep 17 00:00:00 2001 From: Juraj Simon Date: Tue, 2 Apr 2024 12:50:40 +0200 Subject: [PATCH] allow to use action on self hosted server where multiple runners are running and share temp directory --- src/gitleaks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitleaks.js b/src/gitleaks.js index 16b0881..298baae 100644 --- a/src/gitleaks.js +++ b/src/gitleaks.js @@ -20,7 +20,7 @@ const EXIT_CODE_LEAKS_DETECTED = 2; // or use the latest version of gitleaks if GITLEAKS_VERSION is not specified. // This function will also cache the downloaded gitleaks binary in the tool cache. async function Install(version) { - const pathToInstall = path.join(os.tmpdir(), `gitleaks-${version}`); + const pathToInstall = path.join(os.tmpdir(), `gitleaks-${version}-${os.userInfo().username}`); core.info( `Version to install: ${version} (target directory: ${pathToInstall})` ); @@ -50,7 +50,7 @@ async function Install(version) { version ); - const tempPath = path.join(os.tmpdir(), `gitleaks-${version}.tmp`); + const tempPath = path.join(os.tmpdir(), `gitleaks-${version}-${os.userInfo().username}.tmp`); if (!existsSync(tempPath)) { core.info(`Downloading gitleaks from ${gitleaksReleaseURL}...`);