mirror of
https://github.com/actions/checkout.git
synced 2026-01-20 23:58:56 +08:00
Replace uuid with crypto.randomUUID()
This commit is contained in:
parent
ff7abcd0c3
commit
0dcc70b094
4 changed files with 5 additions and 29 deletions
|
|
@ -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})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue