diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/git-auth-helper.ts | 8 | ||||
| -rw-r--r-- | src/github-api-helper.ts | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/git-auth-helper.ts b/src/git-auth-helper.ts index e67db14..1798b10 100644 --- a/src/git-auth-helper.ts +++ b/src/git-auth-helper.ts @@ -8,7 +8,7 @@ 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 {randomUUID} from 'crypto' import {IGitCommandManager} from './git-command-manager' import {IGitSourceSettings} from './git-source-settings' @@ -90,7 +90,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 = randomUUID() this.temporaryHomePath = path.join(runnerTemp, uniqueId) await fs.promises.mkdir(this.temporaryHomePath, {recursive: true}) @@ -255,7 +255,7 @@ class GitAuthHelper { // Write key const runnerTemp = process.env['RUNNER_TEMP'] || '' assert.ok(runnerTemp, 'RUNNER_TEMP is not defined') - const uniqueId = uuid() + const uniqueId = randomUUID() this.sshKeyPath = path.join(runnerTemp, uniqueId) stateHelper.setSshKeyPath(this.sshKeyPath) await fs.promises.mkdir(runnerTemp, {recursive: true}) @@ -422,7 +422,7 @@ class GitAuthHelper { assert.ok(runnerTemp, 'RUNNER_TEMP is not defined') // Create a unique filename for this checkout instance - const configFileName = `git-credentials-${uuid()}.config` + const configFileName = `git-credentials-${randomUUID()}.config` this.credentialsConfigPath = path.join(runnerTemp, configFileName) core.debug(`Credentials config path: ${this.credentialsConfigPath}`) diff --git a/src/github-api-helper.ts b/src/github-api-helper.ts index bef31e6..db42d37 100644 --- a/src/github-api-helper.ts +++ b/src/github-api-helper.ts @@ -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`) |
