diff --git a/package-lock.json b/package-lock.json index 98eb420..3b0fe93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,13 +13,11 @@ "@actions/exec": "^1.1.1", "@actions/github": "^6.0.0", "@actions/io": "^1.1.3", - "@actions/tool-cache": "^2.0.1", - "uuid": "^9.0.1" + "@actions/tool-cache": "^2.0.1" }, "devDependencies": { "@types/jest": "^29.5.12", "@types/node": "^24.1.0", - "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^7.9.0", "@typescript-eslint/parser": "^7.9.0", "@vercel/ncc": "^0.38.1", @@ -1529,12 +1527,6 @@ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, - "node_modules/@types/uuid": { - "version": "9.0.8", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", - "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", - "dev": true - }, "node_modules/@types/yargs": { "version": "17.0.32", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", @@ -6914,18 +6906,6 @@ "punycode": "^2.1.0" } }, - "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", diff --git a/package.json b/package.json index 4b2b58a..17efa63 100644 --- a/package.json +++ b/package.json @@ -32,13 +32,11 @@ "@actions/exec": "^1.1.1", "@actions/github": "^6.0.0", "@actions/io": "^1.1.3", - "@actions/tool-cache": "^2.0.1", - "uuid": "^9.0.1" + "@actions/tool-cache": "^2.0.1" }, "devDependencies": { "@types/jest": "^29.5.12", "@types/node": "^24.1.0", - "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^7.9.0", "@typescript-eslint/parser": "^7.9.0", "@vercel/ncc": "^0.38.1", diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index 126e8e5..be95104 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -8,7 +8,6 @@ import * as path from 'path' import * as regexpHelper from './regexp-helper' import * as stateHelper from './state-helper' import * as urlHelper from './url-helper' -import {v4 as uuid} from 'uuid' import {IGitCommandManager} from './git-command-manager' import {IGitSourceSettings} from './git-source-settings' @@ -89,7 +88,7 @@ class GitAuthHelper { // Create a temp home directory const runnerTemp = process.env['RUNNER_TEMP'] || '' assert.ok(runnerTemp, 'RUNNER_TEMP is not defined') - const uniqueId = uuid() + const uniqueId = crypto.randomUUID() this.temporaryHomePath = path.join(runnerTemp, uniqueId) await fs.promises.mkdir(this.temporaryHomePath, {recursive: true}) @@ -209,7 +208,7 @@ class GitAuthHelper { // Write key const runnerTemp = process.env['RUNNER_TEMP'] || '' assert.ok(runnerTemp, 'RUNNER_TEMP is not defined') - const uniqueId = uuid() + const uniqueId = crypto.randomUUID() this.sshKeyPath = path.join(runnerTemp, uniqueId) stateHelper.setSshKeyPath(this.sshKeyPath) await fs.promises.mkdir(runnerTemp, {recursive: true}) diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts index 1ff27c2..4303cf9 100644 --- a/src/github-api-helper.ts +++ b/src/github-api-helper.ts @@ -6,7 +6,6 @@ import * as io from '@actions/io' import * as path from 'path' import * as retryHelper from './retry-helper' import * as toolCache from '@actions/tool-cache' -import {v4 as uuid} from 'uuid' import {getServerApiUrl} from './url-helper' const IS_WINDOWS = process.platform === 'win32' @@ -34,7 +33,7 @@ export async function downloadRepository( // Write archive to disk core.info('Writing archive to disk') - const uniqueId = uuid() + const uniqueId = crypto.randomUUID() const archivePath = IS_WINDOWS ? path.join(repositoryPath, `${uniqueId}.zip`) : path.join(repositoryPath, `${uniqueId}.tar.gz`)