switch to use crpto.randomUUID

This commit is contained in:
Aiqiao Yan
2026-06-16 17:02:16 +00:00
parent 6f1b2974c7
commit b34efac05f
5 changed files with 214 additions and 1521 deletions

View File

@@ -6,7 +6,7 @@ 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 {randomUUID} from 'crypto'
import {getServerApiUrl} from './url-helper'
const IS_WINDOWS = process.platform === 'win32'
@@ -39,7 +39,7 @@ export async function downloadRepository(
// Write archive to disk
core.info('Writing archive to disk')
const uniqueId = uuid()
const uniqueId = randomUUID()
const archivePath = IS_WINDOWS
? path.join(repositoryPath, `${uniqueId}.zip`)
: path.join(repositoryPath, `${uniqueId}.tar.gz`)