refactor: replace uuid dep with Node.js built-in crypto.randomUUID (#4377)

Replace the third-party `uuid` package with the native `crypto.randomUUID()`
function available in Node.js, reducing the bundle size and external
dependencies.

- Remove `uuid` from `dependencies` in `package.json`
- Replace `import {v4 as uuidv4} from 'uuid'` with `import {randomUUID} from 'crypto'` in `src/create-or-update-branch.ts`
- Replace all `uuidv4()` calls with `randomUUID()` in `__test__/create-or-update-branch.int.test.ts`
- Rebuild `dist/index.js`, removing ~680 lines of bundled `uuid` library code
- Update `package-lock.json` to reflect removed dependency
This commit is contained in:
Peter Evans
2026-05-06 12:10:34 +01:00
committed by GitHub
parent d8c15c739f
commit aa523f9db6
5 changed files with 94 additions and 776 deletions
+75 -75
View File
@@ -4,10 +4,10 @@ import {
getWorkingBaseAndType, getWorkingBaseAndType,
buildBranchCommits buildBranchCommits
} from '../lib/create-or-update-branch' } from '../lib/create-or-update-branch'
import {randomUUID} from 'crypto'
import * as fs from 'fs' import * as fs from 'fs'
import {GitCommandManager} from '../lib/git-command-manager' import {GitCommandManager} from '../lib/git-command-manager'
import * as path from 'path' import * as path from 'path'
import {v4 as uuidv4} from 'uuid'
const REPO_PATH = '/git/local/repos/test-base' const REPO_PATH = '/git/local/repos/test-base'
const REMOTE_NAME = 'origin' const REMOTE_NAME = 'origin'
@@ -31,7 +31,7 @@ const ADD_PATHS_MULTI = ['a', 'b']
const ADD_PATHS_WILDCARD = ['a/*.txt', 'b/*.txt'] const ADD_PATHS_WILDCARD = ['a/*.txt', 'b/*.txt']
async function createFile(filename: string, content?: string): Promise<string> { async function createFile(filename: string, content?: string): Promise<string> {
const _content = content ? content : uuidv4() const _content = content ? content : randomUUID()
const filepath = path.join(REPO_PATH, filename) const filepath = path.join(REPO_PATH, filename)
await fs.promises.mkdir(path.dirname(filepath), {recursive: true}) await fs.promises.mkdir(path.dirname(filepath), {recursive: true})
await fs.promises.writeFile(filepath, _content, {encoding: 'utf8'}) await fs.promises.writeFile(filepath, _content, {encoding: 'utf8'})
@@ -82,7 +82,7 @@ async function createCommits(
} else { } else {
result.changes = await createChanges() result.changes = await createChanges()
} }
const commitMessage = uuidv4() const commitMessage = randomUUID()
await git.exec(['add', '-A']) await git.exec(['add', '-A'])
await git.commit(['-m', commitMessage]) await git.commit(['-m', commitMessage])
result.commitMsgs.unshift(commitMessage) result.commitMsgs.unshift(commitMessage)
@@ -313,7 +313,7 @@ describe('create-or-update-branch tests', () => {
}) })
it('tests no changes resulting in no new branch being created', async () => { it('tests no changes resulting in no new branch being created', async () => {
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -330,7 +330,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with a tracked file change', async () => { it('tests create and update with a tracked file change', async () => {
// Create a tracked file change // Create a tracked file change
const trackedContent = await createFile(TRACKED_FILE) const trackedContent = await createFile(TRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -359,7 +359,7 @@ describe('create-or-update-branch tests', () => {
// Create a tracked file change // Create a tracked file change
const _trackedContent = await createFile(TRACKED_FILE) const _trackedContent = await createFile(TRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -381,7 +381,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with an untracked file change', async () => { it('tests create and update with an untracked file change', async () => {
// Create an untracked file change // Create an untracked file change
const untrackedContent = await createFile(UNTRACKED_FILE) const untrackedContent = await createFile(UNTRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -410,7 +410,7 @@ describe('create-or-update-branch tests', () => {
// Create an untracked file change // Create an untracked file change
const _untrackedContent = await createFile(UNTRACKED_FILE) const _untrackedContent = await createFile(UNTRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -434,7 +434,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -464,7 +464,7 @@ describe('create-or-update-branch tests', () => {
// Create identical tracked and untracked file changes // Create identical tracked and untracked file changes
await createChanges(changes.tracked, changes.untracked) await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -486,7 +486,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with commits on the base inbetween', async () => { it('tests create and update with commits on the base inbetween', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -524,7 +524,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -556,7 +556,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -585,7 +585,7 @@ describe('create-or-update-branch tests', () => {
await beforeTest() await beforeTest()
// Running with no update effectively reverts the branch back to match the base // Running with no update effectively reverts the branch back to match the base
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -607,7 +607,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -648,7 +648,7 @@ describe('create-or-update-branch tests', () => {
commits.changes.tracked, commits.changes.tracked,
commits.changes.untracked commits.changes.untracked
) )
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -673,7 +673,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -703,7 +703,7 @@ describe('create-or-update-branch tests', () => {
// Create a commit on the base with a partial merge of the changes // Create a commit on the base with a partial merge of the changes
await createFile(TRACKED_FILE, changes.tracked) await createFile(TRACKED_FILE, changes.tracked)
const baseCommitMessage = uuidv4() const baseCommitMessage = randomUUID()
await git.exec(['add', '-A']) await git.exec(['add', '-A'])
await git.commit(['-m', baseCommitMessage]) await git.commit(['-m', baseCommitMessage])
await git.push([ await git.push([
@@ -714,7 +714,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes // Create the same tracked and untracked file changes
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -746,7 +746,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -790,7 +790,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -816,7 +816,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -845,7 +845,7 @@ describe('create-or-update-branch tests', () => {
await beforeTest() await beforeTest()
// Force push the base branch to a different commit // Force push the base branch to a different commit
const amendedCommitMessage = uuidv4() const amendedCommitMessage = randomUUID()
await git.commit(['--amend', '-m', amendedCommitMessage]) await git.commit(['--amend', '-m', amendedCommitMessage])
await git.push([ await git.push([
'--force', '--force',
@@ -855,7 +855,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -878,7 +878,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with commits on the working base (during the workflow)', async () => { it('tests create and update with commits on the working base (during the workflow)', async () => {
// Create commits on the working base // Create commits on the working base
const commits = await createCommits(git) const commits = await createCommits(git)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -910,7 +910,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const _commits = await createCommits(git) const _commits = await createCommits(git)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -937,7 +937,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -973,7 +973,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1002,7 +1002,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1046,7 +1046,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1074,7 +1074,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update using a different remote from the base', async () => { it('tests create and update using a different remote from the base', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1104,7 +1104,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1127,7 +1127,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with signoff on commit', async () => { it('tests create and update with signoff on commit', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1164,7 +1164,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1194,7 +1194,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with multiple add-paths', async () => { it('tests create and update with multiple add-paths', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1224,7 +1224,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1247,7 +1247,7 @@ describe('create-or-update-branch tests', () => {
it('tests create and update with wildcard add-paths', async () => { it('tests create and update with wildcard add-paths', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1277,7 +1277,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1300,7 +1300,7 @@ describe('create-or-update-branch tests', () => {
it('tests create with add-paths resolving to no changes when other changes exist', async () => { it('tests create with add-paths resolving to no changes when other changes exist', async () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
await createChanges() await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1321,7 +1321,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const resultA = await createOrUpdateBranch( const resultA = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1365,7 +1365,7 @@ describe('create-or-update-branch tests', () => {
// Set the working base to a branch that is not the pull request base // Set the working base to a branch that is not the pull request base
await git.checkout(NOT_BASE_BRANCH) await git.checkout(NOT_BASE_BRANCH)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1386,7 +1386,7 @@ describe('create-or-update-branch tests', () => {
// Create a tracked file change // Create a tracked file change
const trackedContent = await createFile(TRACKED_FILE) const trackedContent = await createFile(TRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1418,7 +1418,7 @@ describe('create-or-update-branch tests', () => {
// Create a tracked file change // Create a tracked file change
const _trackedContent = await createFile(TRACKED_FILE) const _trackedContent = await createFile(TRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1443,7 +1443,7 @@ describe('create-or-update-branch tests', () => {
// Create an untracked file change // Create an untracked file change
const untrackedContent = await createFile(UNTRACKED_FILE) const untrackedContent = await createFile(UNTRACKED_FILE)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1475,7 +1475,7 @@ describe('create-or-update-branch tests', () => {
// Create an untracked file change // Create an untracked file change
const _untrackedContent = await createFile(UNTRACKED_FILE) const _untrackedContent = await createFile(UNTRACKED_FILE)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1502,7 +1502,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1535,7 +1535,7 @@ describe('create-or-update-branch tests', () => {
// Create identical tracked and untracked file changes // Create identical tracked and untracked file changes
await createChanges(changes.tracked, changes.untracked) await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1560,7 +1560,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1601,7 +1601,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1635,7 +1635,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1667,7 +1667,7 @@ describe('create-or-update-branch tests', () => {
await git.checkout(NOT_BASE_BRANCH) await git.checkout(NOT_BASE_BRANCH)
// Running with no update effectively reverts the branch back to match the base // Running with no update effectively reverts the branch back to match the base
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1694,7 +1694,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1738,7 +1738,7 @@ describe('create-or-update-branch tests', () => {
commits.changes.tracked, commits.changes.tracked,
commits.changes.untracked commits.changes.untracked
) )
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1768,7 +1768,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1798,7 +1798,7 @@ describe('create-or-update-branch tests', () => {
// Create a commit on the base with a partial merge of the changes // Create a commit on the base with a partial merge of the changes
await createFile(TRACKED_FILE, changes.tracked) await createFile(TRACKED_FILE, changes.tracked)
const baseCommitMessage = uuidv4() const baseCommitMessage = randomUUID()
await git.exec(['add', '-A']) await git.exec(['add', '-A'])
await git.commit(['-m', baseCommitMessage]) await git.commit(['-m', baseCommitMessage])
await git.push([ await git.push([
@@ -1812,7 +1812,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes // Create the same tracked and untracked file changes
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1846,7 +1846,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1893,7 +1893,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1924,7 +1924,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -1953,7 +1953,7 @@ describe('create-or-update-branch tests', () => {
await beforeTest() await beforeTest()
// Force push the base branch to a different commit // Force push the base branch to a different commit
const amendedCommitMessage = uuidv4() const amendedCommitMessage = randomUUID()
await git.commit(['--amend', '-m', amendedCommitMessage]) await git.commit(['--amend', '-m', amendedCommitMessage])
await git.push([ await git.push([
'--force', '--force',
@@ -1966,7 +1966,7 @@ describe('create-or-update-branch tests', () => {
// Create the same tracked and untracked file changes (no change on update) // Create the same tracked and untracked file changes (no change on update)
const _changes = await createChanges(changes.tracked, changes.untracked) const _changes = await createChanges(changes.tracked, changes.untracked)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -1992,7 +1992,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const commits = await createCommits(git) const commits = await createCommits(git)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2027,7 +2027,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const _commits = await createCommits(git) const _commits = await createCommits(git)
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2057,7 +2057,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2096,7 +2096,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2128,7 +2128,7 @@ describe('create-or-update-branch tests', () => {
const commits = await createCommits(git) const commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2175,7 +2175,7 @@ describe('create-or-update-branch tests', () => {
const _commits = await createCommits(git) const _commits = await createCommits(git)
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2205,7 +2205,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2238,7 +2238,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2268,7 +2268,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2302,7 +2302,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2329,7 +2329,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2371,7 +2371,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const _changes = await createChanges() const _changes = await createChanges()
const _commitMessage = uuidv4() const _commitMessage = randomUUID()
const _result = await createOrUpdateBranch( const _result = await createOrUpdateBranch(
git, git,
_commitMessage, _commitMessage,
@@ -2403,7 +2403,7 @@ describe('create-or-update-branch tests', () => {
// Create commits on the working base // Create commits on the working base
const commits = await createCommits(git) const commits = await createCommits(git)
const commitMessage = uuidv4() const commitMessage = randomUUID()
const result = await createOrUpdateBranch( const result = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
@@ -2428,7 +2428,7 @@ describe('create-or-update-branch tests', () => {
// Create tracked and untracked file changes // Create tracked and untracked file changes
const changes = await createChanges() const changes = await createChanges()
const commitMessage = uuidv4() const commitMessage = randomUUID()
const resultA = await createOrUpdateBranch( const resultA = await createOrUpdateBranch(
git, git,
commitMessage, commitMessage,
+2 -683
View File
@@ -55,7 +55,7 @@ exports.tryFetch = tryFetch;
exports.buildBranchCommits = buildBranchCommits; exports.buildBranchCommits = buildBranchCommits;
exports.createOrUpdateBranch = createOrUpdateBranch; exports.createOrUpdateBranch = createOrUpdateBranch;
const core = __importStar(__nccwpck_require__(7484)); const core = __importStar(__nccwpck_require__(7484));
const uuid_1 = __nccwpck_require__(2048); const crypto_1 = __nccwpck_require__(6982);
const utils = __importStar(__nccwpck_require__(9277)); const utils = __importStar(__nccwpck_require__(9277));
const CHERRYPICK_EMPTY = 'The previous cherry-pick is now empty, possibly due to conflict resolution.'; const CHERRYPICK_EMPTY = 'The previous cherry-pick is now empty, possibly due to conflict resolution.';
const NOTHING_TO_COMMIT = 'nothing to commit, working tree clean'; const NOTHING_TO_COMMIT = 'nothing to commit, working tree clean';
@@ -182,7 +182,7 @@ function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName
base = base ? base : workingBase; base = base ? base : workingBase;
const baseRemote = 'origin'; const baseRemote = 'origin';
// Save the working base changes to a temporary branch // Save the working base changes to a temporary branch
const tempBranch = (0, uuid_1.v4)(); const tempBranch = (0, crypto_1.randomUUID)();
yield git.checkout(tempBranch, 'HEAD'); yield git.checkout(tempBranch, 'HEAD');
// Commit any uncommitted changes // Commit any uncommitted changes
if (yield git.isDirty(true, addPaths)) { if (yield git.isDirty(true, addPaths)) {
@@ -29229,687 +29229,6 @@ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
exports.debug = debug; // for test exports.debug = debug; // for test
/***/ }),
/***/ 2048:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
Object.defineProperty(exports, "NIL", ({
enumerable: true,
get: function () {
return _nil.default;
}
}));
Object.defineProperty(exports, "parse", ({
enumerable: true,
get: function () {
return _parse.default;
}
}));
Object.defineProperty(exports, "stringify", ({
enumerable: true,
get: function () {
return _stringify.default;
}
}));
Object.defineProperty(exports, "v1", ({
enumerable: true,
get: function () {
return _v.default;
}
}));
Object.defineProperty(exports, "v3", ({
enumerable: true,
get: function () {
return _v2.default;
}
}));
Object.defineProperty(exports, "v4", ({
enumerable: true,
get: function () {
return _v3.default;
}
}));
Object.defineProperty(exports, "v5", ({
enumerable: true,
get: function () {
return _v4.default;
}
}));
Object.defineProperty(exports, "validate", ({
enumerable: true,
get: function () {
return _validate.default;
}
}));
Object.defineProperty(exports, "version", ({
enumerable: true,
get: function () {
return _version.default;
}
}));
var _v = _interopRequireDefault(__nccwpck_require__(6415));
var _v2 = _interopRequireDefault(__nccwpck_require__(1697));
var _v3 = _interopRequireDefault(__nccwpck_require__(4676));
var _v4 = _interopRequireDefault(__nccwpck_require__(9771));
var _nil = _interopRequireDefault(__nccwpck_require__(7723));
var _version = _interopRequireDefault(__nccwpck_require__(5868));
var _validate = _interopRequireDefault(__nccwpck_require__(6200));
var _stringify = _interopRequireDefault(__nccwpck_require__(7597));
var _parse = _interopRequireDefault(__nccwpck_require__(7267));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/***/ 216:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _crypto = _interopRequireDefault(__nccwpck_require__(6982));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function md5(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return _crypto.default.createHash('md5').update(bytes).digest();
}
var _default = md5;
exports["default"] = _default;
/***/ }),
/***/ 4221:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _crypto = _interopRequireDefault(__nccwpck_require__(6982));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {
randomUUID: _crypto.default.randomUUID
};
exports["default"] = _default;
/***/ }),
/***/ 7723:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _default = '00000000-0000-0000-0000-000000000000';
exports["default"] = _default;
/***/ }),
/***/ 7267:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _validate = _interopRequireDefault(__nccwpck_require__(6200));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function parse(uuid) {
if (!(0, _validate.default)(uuid)) {
throw TypeError('Invalid UUID');
}
let v;
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
arr[1] = v >>> 16 & 0xff;
arr[2] = v >>> 8 & 0xff;
arr[3] = v & 0xff; // Parse ........-####-....-....-............
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
arr[5] = v & 0xff; // Parse ........-....-####-....-............
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
arr[7] = v & 0xff; // Parse ........-....-....-####-............
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
arr[9] = v & 0xff; // Parse ........-....-....-....-############
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
arr[11] = v / 0x100000000 & 0xff;
arr[12] = v >>> 24 & 0xff;
arr[13] = v >>> 16 & 0xff;
arr[14] = v >>> 8 & 0xff;
arr[15] = v & 0xff;
return arr;
}
var _default = parse;
exports["default"] = _default;
/***/ }),
/***/ 7879:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
exports["default"] = _default;
/***/ }),
/***/ 2973:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = rng;
var _crypto = _interopRequireDefault(__nccwpck_require__(6982));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
let poolPtr = rnds8Pool.length;
function rng() {
if (poolPtr > rnds8Pool.length - 16) {
_crypto.default.randomFillSync(rnds8Pool);
poolPtr = 0;
}
return rnds8Pool.slice(poolPtr, poolPtr += 16);
}
/***/ }),
/***/ 507:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _crypto = _interopRequireDefault(__nccwpck_require__(6982));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function sha1(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return _crypto.default.createHash('sha1').update(bytes).digest();
}
var _default = sha1;
exports["default"] = _default;
/***/ }),
/***/ 7597:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
exports.unsafeStringify = unsafeStringify;
var _validate = _interopRequireDefault(__nccwpck_require__(6200));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
const byteToHex = [];
for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 0x100).toString(16).slice(1));
}
function unsafeStringify(arr, offset = 0) {
// Note: Be careful editing this code! It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
}
function stringify(arr, offset = 0) {
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if (!(0, _validate.default)(uuid)) {
throw TypeError('Stringified UUID is invalid');
}
return uuid;
}
var _default = stringify;
exports["default"] = _default;
/***/ }),
/***/ 6415:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _rng = _interopRequireDefault(__nccwpck_require__(2973));
var _stringify = __nccwpck_require__(7597);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
let _nodeId;
let _clockseq; // Previous uuid creation time
let _lastMSecs = 0;
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
let i = buf && offset || 0;
const b = buf || new Array(16);
options = options || {};
let node = options.node || _nodeId;
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
// specified. We do this lazily to minimize issues related to insufficient
// system entropy. See #189
if (node == null || clockseq == null) {
const seedBytes = options.random || (options.rng || _rng.default)();
if (node == null) {
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
}
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
}
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
} // Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000; // `time_low`
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff; // `time_mid`
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff; // `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
b[i++] = clockseq & 0xff; // `node`
for (let n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || (0, _stringify.unsafeStringify)(b);
}
var _default = v1;
exports["default"] = _default;
/***/ }),
/***/ 1697:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _v = _interopRequireDefault(__nccwpck_require__(2930));
var _md = _interopRequireDefault(__nccwpck_require__(216));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const v3 = (0, _v.default)('v3', 0x30, _md.default);
var _default = v3;
exports["default"] = _default;
/***/ }),
/***/ 2930:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.URL = exports.DNS = void 0;
exports["default"] = v35;
var _stringify = __nccwpck_require__(7597);
var _parse = _interopRequireDefault(__nccwpck_require__(7267));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function stringToBytes(str) {
str = unescape(encodeURIComponent(str)); // UTF8 escape
const bytes = [];
for (let i = 0; i < str.length; ++i) {
bytes.push(str.charCodeAt(i));
}
return bytes;
}
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
exports.DNS = DNS;
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
exports.URL = URL;
function v35(name, version, hashfunc) {
function generateUUID(value, namespace, buf, offset) {
var _namespace;
if (typeof value === 'string') {
value = stringToBytes(value);
}
if (typeof namespace === 'string') {
namespace = (0, _parse.default)(namespace);
}
if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
} // Compute hash of namespace and value, Per 4.3
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
// hashfunc([...namespace, ... value])`
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 0x0f | version;
bytes[8] = bytes[8] & 0x3f | 0x80;
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = bytes[i];
}
return buf;
}
return (0, _stringify.unsafeStringify)(bytes);
} // Function#name is not settable on some platforms (#270)
try {
generateUUID.name = name; // eslint-disable-next-line no-empty
} catch (err) {} // For CommonJS default export support
generateUUID.DNS = DNS;
generateUUID.URL = URL;
return generateUUID;
}
/***/ }),
/***/ 4676:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _native = _interopRequireDefault(__nccwpck_require__(4221));
var _rng = _interopRequireDefault(__nccwpck_require__(2973));
var _stringify = __nccwpck_require__(7597);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function v4(options, buf, offset) {
if (_native.default.randomUUID && !buf && !options) {
return _native.default.randomUUID();
}
options = options || {};
const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return (0, _stringify.unsafeStringify)(rnds);
}
var _default = v4;
exports["default"] = _default;
/***/ }),
/***/ 9771:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _v = _interopRequireDefault(__nccwpck_require__(2930));
var _sha = _interopRequireDefault(__nccwpck_require__(507));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const v5 = (0, _v.default)('v5', 0x50, _sha.default);
var _default = v5;
exports["default"] = _default;
/***/ }),
/***/ 6200:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _regex = _interopRequireDefault(__nccwpck_require__(7879));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function validate(uuid) {
return typeof uuid === 'string' && _regex.default.test(uuid);
}
var _default = validate;
exports["default"] = _default;
/***/ }),
/***/ 5868:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _validate = _interopRequireDefault(__nccwpck_require__(6200));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function version(uuid) {
if (!(0, _validate.default)(uuid)) {
throw TypeError('Invalid UUID');
}
return parseInt(uuid.slice(14, 15), 16);
}
var _default = version;
exports["default"] = _default;
/***/ }), /***/ }),
/***/ 2613: /***/ 2613:
+14 -14
View File
@@ -18,8 +18,7 @@
"@octokit/plugin-throttling": "^9.6.1", "@octokit/plugin-throttling": "^9.6.1",
"@octokit/request-error": "^6.1.8", "@octokit/request-error": "^6.1.8",
"node-fetch-native": "^1.6.7", "node-fetch-native": "^1.6.7",
"p-limit": "^6.2.0", "p-limit": "^6.2.0"
"uuid": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
@@ -153,6 +152,7 @@
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz",
"integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.24.7", "@babel/code-frame": "^7.24.7",
@@ -719,6 +719,7 @@
} }
], ],
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=18" "node": ">=18"
}, },
@@ -742,6 +743,7 @@
} }
], ],
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=18" "node": ">=18"
} }
@@ -1636,6 +1638,7 @@
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.6.tgz", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-6.1.6.tgz",
"integrity": "sha512-kIU8SLQkYWGp3pVKiYzA5OSaNF5EE03P/R8zEmmrG6XwOg5oBjXyQVVIauQ0dgau4zYhpZEhJrvIYt6oM+zZZA==", "integrity": "sha512-kIU8SLQkYWGp3pVKiYzA5OSaNF5EE03P/R8zEmmrG6XwOg5oBjXyQVVIauQ0dgau4zYhpZEhJrvIYt6oM+zZZA==",
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@octokit/auth-token": "^5.0.0", "@octokit/auth-token": "^5.0.0",
"@octokit/graphql": "^8.2.2", "@octokit/graphql": "^8.2.2",
@@ -2884,6 +2887,7 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
"integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
"dev": true, "dev": true,
"peer": true,
"bin": { "bin": {
"acorn": "bin/acorn" "acorn": "bin/acorn"
}, },
@@ -3359,6 +3363,7 @@
"url": "https://github.com/sponsors/ai" "url": "https://github.com/sponsors/ai"
} }
], ],
"peer": true,
"dependencies": { "dependencies": {
"caniuse-lite": "^1.0.30001640", "caniuse-lite": "^1.0.30001640",
"electron-to-chromium": "^1.4.820", "electron-to-chromium": "^1.4.820",
@@ -4167,6 +4172,7 @@
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz",
"integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1", "@eslint-community/regexpp": "^4.6.1",
@@ -4413,6 +4419,7 @@
"integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"@rtsao/scc": "^1.1.0", "@rtsao/scc": "^1.1.0",
"array-includes": "^3.1.9", "array-includes": "^3.1.9",
@@ -5991,6 +5998,7 @@
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
"integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==",
"dev": true, "dev": true,
"peer": true,
"dependencies": { "dependencies": {
"@jest/core": "^29.7.0", "@jest/core": "^29.7.0",
"@jest/types": "^29.6.3", "@jest/types": "^29.6.3",
@@ -6865,6 +6873,7 @@
"integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"cssstyle": "^4.2.1", "cssstyle": "^4.2.1",
"data-urls": "^5.0.0", "data-urls": "^5.0.0",
@@ -7703,6 +7712,7 @@
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"bin": { "bin": {
"prettier": "bin/prettier.cjs" "prettier": "bin/prettier.cjs"
}, },
@@ -8569,6 +8579,7 @@
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"engines": { "engines": {
"node": ">=12" "node": ">=12"
}, },
@@ -8905,6 +8916,7 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"peer": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@@ -9039,18 +9051,6 @@
"punycode": "^2.1.0" "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": { "node_modules/v8-to-istanbul": {
"version": "9.3.0", "version": "9.3.0",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",
+1 -2
View File
@@ -41,8 +41,7 @@
"@octokit/plugin-throttling": "^9.6.1", "@octokit/plugin-throttling": "^9.6.1",
"@octokit/request-error": "^6.1.8", "@octokit/request-error": "^6.1.8",
"node-fetch-native": "^1.6.7", "node-fetch-native": "^1.6.7",
"p-limit": "^6.2.0", "p-limit": "^6.2.0"
"uuid": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
+2 -2
View File
@@ -1,6 +1,6 @@
import * as core from '@actions/core' import * as core from '@actions/core'
import {randomUUID} from 'crypto'
import {GitCommandManager, Commit} from './git-command-manager' import {GitCommandManager, Commit} from './git-command-manager'
import {v4 as uuidv4} from 'uuid'
import * as utils from './utils' import * as utils from './utils'
const CHERRYPICK_EMPTY = const CHERRYPICK_EMPTY =
@@ -189,7 +189,7 @@ export async function createOrUpdateBranch(
const baseRemote = 'origin' const baseRemote = 'origin'
// Save the working base changes to a temporary branch // Save the working base changes to a temporary branch
const tempBranch = uuidv4() const tempBranch = randomUUID()
await git.checkout(tempBranch, 'HEAD') await git.checkout(tempBranch, 'HEAD')
// Commit any uncommitted changes // Commit any uncommitted changes
if (await git.isDirty(true, addPaths)) { if (await git.isDirty(true, addPaths)) {