diff --git a/.licenses/npm/uuid-9.0.0.dep.yml b/.licenses/npm/uuid-9.0.0.dep.yml new file mode 100644 index 00000000..627fc938 Binary files /dev/null and b/.licenses/npm/uuid-9.0.0.dep.yml differ diff --git a/src/distributions/base-distribution.ts b/src/distributions/base-distribution.ts index bd872ba3..edac6b9b 100644 --- a/src/distributions/base-distribution.ts +++ b/src/distributions/base-distribution.ts @@ -1,3 +1,4 @@ +import {v4 as uuidv4} from 'uuid'; import * as tc from '@actions/tool-cache'; import * as hc from '@actions/http-client'; import * as core from '@actions/core'; @@ -166,9 +167,8 @@ export default abstract class BaseDistribution { const initialUrl = this.getDistributionUrl(); const osArch: string = this.translateArchToDistUrl(arch); - // Create temporary folder to download in to - const tempDownloadFolder: string = - 'temp_' + Math.floor(Math.random() * 2000000000); + // Create temporary folder to download to + const tempDownloadFolder = `temp_${uuidv4()}`; const tempDirectory = process.env['RUNNER_TEMP'] || ''; assert.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined'); const tempDir: string = path.join(tempDirectory, tempDownloadFolder);