mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
Remove dependency on uuid package (#1824)
This commit is contained in:
@@ -10,7 +10,6 @@ import * as stream from 'stream'
|
||||
import * as util from 'util'
|
||||
import {ok} from 'assert'
|
||||
import {OutgoingHttpHeaders} from 'http'
|
||||
import uuidV4 from 'uuid/v4'
|
||||
import {exec} from '@actions/exec/lib/exec'
|
||||
import {ExecOptions} from '@actions/exec/lib/interfaces'
|
||||
import {RetryHelper} from './retry-helper'
|
||||
@@ -41,7 +40,7 @@ export async function downloadTool(
|
||||
auth?: string,
|
||||
headers?: OutgoingHttpHeaders
|
||||
): Promise<string> {
|
||||
dest = dest || path.join(_getTempDirectory(), uuidV4())
|
||||
dest = dest || path.join(_getTempDirectory(), crypto.randomUUID())
|
||||
await io.mkdirP(path.dirname(dest))
|
||||
core.debug(`Downloading ${url}`)
|
||||
core.debug(`Destination ${dest}`)
|
||||
@@ -651,7 +650,7 @@ export async function findFromManifest(
|
||||
async function _createExtractFolder(dest?: string): Promise<string> {
|
||||
if (!dest) {
|
||||
// create a temp dir
|
||||
dest = path.join(_getTempDirectory(), uuidV4())
|
||||
dest = path.join(_getTempDirectory(), crypto.randomUUID())
|
||||
}
|
||||
await io.mkdirP(dest)
|
||||
return dest
|
||||
|
||||
Reference in New Issue
Block a user