From a1962a642f6d7e3d1ee40e8906b01bdd8e7f630a Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:56:00 -0700 Subject: [PATCH] Replace uuid with crypto.randomUUID() --- package-lock.json | 16 +--------------- package.json | 3 +-- src/distributions/base-distribution.ts | 3 +-- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4a35bf12..1e3fded7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,7 @@ "@actions/http-client": "^2.2.1", "@actions/io": "^1.0.2", "@actions/tool-cache": "^2.0.2", - "semver": "^7.6.3", - "uuid": "^11.1.0" + "semver": "^7.6.3" }, "devDependencies": { "@types/jest": "^29.5.14", @@ -5683,19 +5682,6 @@ "punycode": "^2.1.0" } }, - "node_modules/uuid": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", - "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/esm/bin/uuid" - } - }, "node_modules/v8-to-istanbul": { "version": "9.1.3", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", diff --git a/package.json b/package.json index df57ab7c..9d981c7c 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,7 @@ "@actions/http-client": "^2.2.1", "@actions/io": "^1.0.2", "@actions/tool-cache": "^2.0.2", - "semver": "^7.6.3", - "uuid": "^11.1.0" + "semver": "^7.6.3" }, "devDependencies": { "@types/jest": "^29.5.14", diff --git a/src/distributions/base-distribution.ts b/src/distributions/base-distribution.ts index 0a99f3a8..64871981 100644 --- a/src/distributions/base-distribution.ts +++ b/src/distributions/base-distribution.ts @@ -1,4 +1,3 @@ -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'; @@ -185,7 +184,7 @@ export default abstract class BaseDistribution { const osArch: string = this.translateArchToDistUrl(arch); // Create temporary folder to download to - const tempDownloadFolder = `temp_${uuidv4()}`; + const tempDownloadFolder = `temp_${crypto.randomUUID()}`; const tempDirectory = process.env['RUNNER_TEMP'] || ''; assert.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined'); const tempDir: string = path.join(tempDirectory, tempDownloadFolder);