Skip to content

Commit ef58b4a

Browse files
committed
update build
1 parent f087628 commit ef58b4a

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

dist/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69867,10 +69867,19 @@ const EXIT_CODE_LEAKS_DETECTED = 2;
6986769867
// or use the latest version of gitleaks if GITLEAKS_VERSION is not specified.
6986869868
// This function will also cache the downloaded gitleaks binary in the tool cache.
6986969869
async function Install(version) {
69870-
const pathToInstall = path.join(os.tmpdir(), `gitleaks-${version}`);
69870+
const pathToInstall = path.join(os.tmpdir(), `gitleaks-${version}-${os.userInfo().username}`);
6987169871
core.info(
6987269872
`Version to install: ${version} (target directory: ${pathToInstall})`
6987369873
);
69874+
69875+
if (existsSync(pathToInstall)) {
69876+
core.info(`Gitleaks already installed, skipping installation`);
69877+
core.addPath(pathToInstall);
69878+
return;
69879+
} else {
69880+
core.info(`Gitleaks install dir ${pathToInstall} not found, checking github cache...`);
69881+
}
69882+
6987469883
const cacheKey = `gitleaks-cache-${version}-${process.platform}-${process.arch}`;
6987569884
let restoredFromCache = undefined;
6987669885
try {
@@ -69888,7 +69897,7 @@ async function Install(version) {
6988869897
version
6988969898
);
6989069899

69891-
const tempPath = path.join(os.tmpdir(), `gitleaks-${version}.tmp`);
69900+
const tempPath = path.join(os.tmpdir(), `gitleaks-${version}-${os.userInfo().username}.tmp`);
6989269901

6989369902
if (!existsSync(tempPath)) {
6989469903
core.info(`Downloading gitleaks from ${gitleaksReleaseURL}...`);

0 commit comments

Comments
 (0)