mirror of
https://github.com/peter-evans/create-pull-request.git
synced 2026-12-04 04:59:04 +00:00
Compare commits
31
Commits
replace_uuid
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7e12f4cd1 | ||
|
|
658c0d3724 | ||
|
|
2261dc5d77 | ||
|
|
b457f7bfef | ||
|
|
3ffccacd46 | ||
|
|
77d56500d9 | ||
|
|
15733dbdfe | ||
|
|
3afad46a91 | ||
|
|
aee70bea9c | ||
|
|
86c87cfdd8 | ||
|
|
bd09a93810 | ||
|
|
59910dc448 | ||
|
|
753b4376e5 | ||
|
|
abadea5d94 | ||
|
|
11e8dc7c9c | ||
|
|
c9f8b51aaa | ||
|
|
1a3c7ab17d | ||
|
|
762a4a5ab1 | ||
|
|
b99c9ae23b | ||
|
|
11fa467881 | ||
|
|
92f6f0bc90 | ||
|
|
7ec5aae3c9 | ||
|
|
c66b8cb005 | ||
|
|
653ba8b281 | ||
|
|
6fff569d74 | ||
|
|
a78ae501dd | ||
|
|
de36595094 | ||
|
|
5f42108561 | ||
|
|
8c5aeef7f4 | ||
|
|
8b4b9968cb | ||
|
|
aa523f9db6 |
No files matched your search
@@ -5,6 +5,8 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: "monthly"
|
interval: "monthly"
|
||||||
day: "tuesday"
|
day: "tuesday"
|
||||||
|
cooldown:
|
||||||
|
default-days: 3
|
||||||
labels:
|
labels:
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
groups:
|
groups:
|
||||||
@@ -17,6 +19,8 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: "monthly"
|
interval: "monthly"
|
||||||
day: "tuesday"
|
day: "tuesday"
|
||||||
|
cooldown:
|
||||||
|
default-days: 3
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "*"
|
- dependency-name: "*"
|
||||||
update-types: ["version-update:semver-major"]
|
update-types: ["version-update:semver-major"]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.actor == 'dependabot[bot]'
|
if: github.actor == 'dependabot[bot]'
|
||||||
steps:
|
steps:
|
||||||
- uses: peter-evans/enable-pull-request-automerge@v3
|
- uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
pull-request-number: ${{ github.event.pull_request.number }}
|
pull-request-number: ${{ github.event.pull_request.number }}
|
||||||
|
|||||||
+13
-13
@@ -19,8 +19,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||||
with:
|
with:
|
||||||
node-version-file: package.json
|
node-version-file: package.json
|
||||||
cache: npm
|
cache: npm
|
||||||
@@ -29,11 +29,11 @@ jobs:
|
|||||||
- run: npm run format-check
|
- run: npm run format-check
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
- run: npm run test
|
- run: npm run test
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- uses: actions/upload-artifact@v7
|
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: action.yml
|
path: action.yml
|
||||||
@@ -46,16 +46,16 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: [built, committed]
|
target: [built, committed]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
- if: matrix.target == 'built' || github.event_name == 'pull_request'
|
||||||
uses: actions/download-artifact@v8
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||||
with:
|
with:
|
||||||
name: action.yml
|
name: action.yml
|
||||||
path: .
|
path: .
|
||||||
@@ -80,7 +80,7 @@ jobs:
|
|||||||
branch: ci-test-${{ matrix.target }}-${{ github.sha }}
|
branch: ci-test-${{ matrix.target }}-${{ github.sha }}
|
||||||
|
|
||||||
- name: Close Pull
|
- name: Close Pull
|
||||||
uses: peter-evans/close-pull@v3
|
uses: peter-evans/close-pull@a192af8d70f2d49c49643134605c3b73d4f80fae # v3.0.1
|
||||||
with:
|
with:
|
||||||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
|
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
|
||||||
comment: '[CI] test ${{ matrix.target }}'
|
comment: '[CI] test ${{ matrix.target }}'
|
||||||
@@ -92,7 +92,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Find Comment
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@v4
|
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
|
||||||
id: fc
|
id: fc
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
|
|
||||||
- if: steps.fc.outputs.comment-id == ''
|
- if: steps.fc.outputs.comment-id == ''
|
||||||
name: Create comment
|
name: Create comment
|
||||||
uses: peter-evans/create-or-update-comment@v5
|
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.number }}
|
issue-number: ${{ github.event.number }}
|
||||||
body: |
|
body: |
|
||||||
@@ -118,13 +118,13 @@ jobs:
|
|||||||
needs: [test]
|
needs: [test]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
- uses: actions/download-artifact@v8
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v8
|
uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
commit-message: 'build: update distribution'
|
commit-message: 'build: update distribution'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ jobs:
|
|||||||
createPullRequest:
|
createPullRequest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
|
||||||
- name: Make changes to pull request
|
- name: Make changes to pull request
|
||||||
run: date +%s > report.txt
|
run: date +%s > report.txt
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||||
|
|
||||||
- name: Add reaction
|
- name: Add reaction
|
||||||
uses: peter-evans/create-or-update-comment@v5
|
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
||||||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
|
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Slash Command Dispatch
|
- name: Slash Command Dispatch
|
||||||
uses: peter-evans/slash-command-dispatch@v5
|
uses: peter-evans/slash-command-dispatch@9bdcd7914ec1b75590b790b844aa3b8eee7c683a # v5.0.2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
config: >
|
config: >
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
tag:
|
tag:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -27,6 +27,13 @@ jobs:
|
|||||||
git config user.name actions-bot
|
git config user.name actions-bot
|
||||||
git config user.email actions-bot@users.noreply.github.com
|
git config user.email actions-bot@users.noreply.github.com
|
||||||
- name: Tag new target
|
- name: Tag new target
|
||||||
run: git tag -f ${{ github.event.inputs.main_version }} ${{ github.event.inputs.target }}
|
run: |
|
||||||
|
sha=$(git rev-parse --verify --end-of-options "${INPUT_TARGET}^{commit}")
|
||||||
|
git tag -f "${INPUT_MAIN_VERSION}" "${sha}"
|
||||||
|
env:
|
||||||
|
INPUT_MAIN_VERSION: ${{ github.event.inputs.main_version }}
|
||||||
|
INPUT_TARGET: ${{ github.event.inputs.target }}
|
||||||
- name: Push new tag
|
- name: Push new tag
|
||||||
run: git push origin ${{ github.event.inputs.main_version }} --force
|
run: git push origin "${INPUT_MAIN_VERSION}" --force
|
||||||
|
env:
|
||||||
|
INPUT_MAIN_VERSION: ${{ github.event.inputs.main_version }}
|
||||||
@@ -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,
|
||||||
|
|||||||
@@ -0,0 +1,182 @@
|
|||||||
|
import {GitHubHelper} from '../lib/github-helper'
|
||||||
|
import {Commit, GitCommandManager} from '../lib/git-command-manager'
|
||||||
|
|
||||||
|
const mockOctokit = {
|
||||||
|
rest: {
|
||||||
|
git: {
|
||||||
|
createBlob: jest.fn(),
|
||||||
|
createTree: jest.fn(),
|
||||||
|
createCommit: jest.fn(),
|
||||||
|
createRef: jest.fn(),
|
||||||
|
getRef: jest.fn(),
|
||||||
|
updateRef: jest.fn()
|
||||||
|
},
|
||||||
|
repos: {
|
||||||
|
getBranch: jest.fn()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jest.mock('../lib/octokit-client', () => ({
|
||||||
|
Octokit: jest.fn(() => mockOctokit),
|
||||||
|
throttleOptions: {},
|
||||||
|
retryOptions: {}
|
||||||
|
}))
|
||||||
|
jest.mock('@octokit/request-error', () => ({RequestError: class {}}))
|
||||||
|
jest.mock('p-limit', () => () => (fn: () => unknown) => fn())
|
||||||
|
|
||||||
|
const NULL_SHA = '0000000000000000000000000000000000000000'
|
||||||
|
|
||||||
|
function makeCommit(changes: Commit['changes']): Commit {
|
||||||
|
return {
|
||||||
|
sha: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
||||||
|
tree: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
|
||||||
|
parents: ['cccccccccccccccccccccccccccccccccccccccc'],
|
||||||
|
signed: false,
|
||||||
|
subject: 'Test commit',
|
||||||
|
body: '',
|
||||||
|
changes,
|
||||||
|
unparsedChanges: []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('github-helper unit tests', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('pushSignedCommits deletes a removed submodule instead of pointing it at the null sha', async () => {
|
||||||
|
const {git: gitApi} = mockOctokit.rest
|
||||||
|
gitApi.createBlob.mockResolvedValue({
|
||||||
|
data: {sha: 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'}
|
||||||
|
})
|
||||||
|
gitApi.createTree.mockResolvedValue({
|
||||||
|
data: {sha: 'dddddddddddddddddddddddddddddddddddddddd'}
|
||||||
|
})
|
||||||
|
gitApi.createCommit.mockResolvedValue({
|
||||||
|
data: {
|
||||||
|
sha: 'ffffffffffffffffffffffffffffffffffffffff',
|
||||||
|
tree: {sha: 'dddddddddddddddddddddddddddddddddddddddd'},
|
||||||
|
verification: {verified: true, reason: 'valid'}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
gitApi.createRef.mockResolvedValue({})
|
||||||
|
gitApi.getRef.mockRejectedValue(new Error('Not Found'))
|
||||||
|
const git = {
|
||||||
|
showFileAtRefBase64: jest.fn().mockResolvedValue('Y29udGVudA==')
|
||||||
|
}
|
||||||
|
|
||||||
|
const helper = new GitHubHelper('github.com', 'token')
|
||||||
|
|
||||||
|
const baseCommit = makeCommit([])
|
||||||
|
const commit = makeCommit([
|
||||||
|
{
|
||||||
|
mode: '160000',
|
||||||
|
dstSha: NULL_SHA,
|
||||||
|
status: 'D',
|
||||||
|
path: 'submodules/removed'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
mode: '160000',
|
||||||
|
dstSha: '1111111111111111111111111111111111111111',
|
||||||
|
status: 'M',
|
||||||
|
path: 'submodules/updated'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
mode: '100644',
|
||||||
|
dstSha: '2222222222222222222222222222222222222222',
|
||||||
|
status: 'M',
|
||||||
|
path: '.gitmodules'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
await helper.pushSignedCommits(
|
||||||
|
git as unknown as GitCommandManager,
|
||||||
|
[commit],
|
||||||
|
baseCommit,
|
||||||
|
'/repo',
|
||||||
|
'owner/repo',
|
||||||
|
'branch'
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(gitApi.createTree).toHaveBeenCalledTimes(1)
|
||||||
|
const {tree} = gitApi.createTree.mock.calls[0][0]
|
||||||
|
expect(tree).toEqual([
|
||||||
|
{
|
||||||
|
path: 'submodules/removed',
|
||||||
|
mode: '160000',
|
||||||
|
sha: null,
|
||||||
|
type: 'commit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'submodules/updated',
|
||||||
|
mode: '160000',
|
||||||
|
sha: '1111111111111111111111111111111111111111',
|
||||||
|
type: 'commit'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '.gitmodules',
|
||||||
|
mode: '100644',
|
||||||
|
sha: 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
|
||||||
|
type: 'blob'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
})
|
||||||
|
|
||||||
|
test('pushSignedCommits creates the ref when the branch name only resolves via a branch rename redirect', async () => {
|
||||||
|
const {git: gitApi, repos: reposApi} = mockOctokit.rest
|
||||||
|
// The branches API follows rename redirects and returns the renamed branch
|
||||||
|
reposApi.getBranch.mockResolvedValue({data: {name: 'renamed-branch'}})
|
||||||
|
gitApi.getRef.mockRejectedValue(new Error('Not Found'))
|
||||||
|
gitApi.createRef.mockResolvedValue({})
|
||||||
|
|
||||||
|
const helper = new GitHubHelper('github.com', 'token')
|
||||||
|
const baseCommit = makeCommit([])
|
||||||
|
await helper.pushSignedCommits(
|
||||||
|
{} as GitCommandManager,
|
||||||
|
[],
|
||||||
|
baseCommit,
|
||||||
|
'/repo',
|
||||||
|
'owner/repo',
|
||||||
|
'branch'
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(gitApi.getRef).toHaveBeenCalledWith({
|
||||||
|
owner: 'owner',
|
||||||
|
repo: 'repo',
|
||||||
|
ref: 'heads/branch'
|
||||||
|
})
|
||||||
|
expect(gitApi.createRef).toHaveBeenCalledWith({
|
||||||
|
owner: 'owner',
|
||||||
|
repo: 'repo',
|
||||||
|
sha: baseCommit.sha,
|
||||||
|
ref: 'refs/heads/branch'
|
||||||
|
})
|
||||||
|
expect(gitApi.updateRef).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('pushSignedCommits updates the ref when the branch exists', async () => {
|
||||||
|
const {git: gitApi} = mockOctokit.rest
|
||||||
|
gitApi.getRef.mockResolvedValue({data: {ref: 'refs/heads/branch'}})
|
||||||
|
gitApi.updateRef.mockResolvedValue({})
|
||||||
|
|
||||||
|
const helper = new GitHubHelper('github.com', 'token')
|
||||||
|
const baseCommit = makeCommit([])
|
||||||
|
await helper.pushSignedCommits(
|
||||||
|
{} as GitCommandManager,
|
||||||
|
[],
|
||||||
|
baseCommit,
|
||||||
|
'/repo',
|
||||||
|
'owner/repo',
|
||||||
|
'branch'
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(gitApi.updateRef).toHaveBeenCalledWith({
|
||||||
|
owner: 'owner',
|
||||||
|
repo: 'repo',
|
||||||
|
sha: baseCommit.sha,
|
||||||
|
ref: 'heads/branch',
|
||||||
|
force: true
|
||||||
|
})
|
||||||
|
expect(gitApi.createRef).not.toHaveBeenCalled()
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -10,7 +10,7 @@ if [[ "$(docker images -q $IMAGE 2> /dev/null)" == "" || $ARG1 == "build" ]]; th
|
|||||||
cat > Dockerfile << EOF
|
cat > Dockerfile << EOF
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
RUN apk --no-cache add git git-daemon
|
RUN apk --no-cache add git git-daemon
|
||||||
RUN npm install jest jest-environment-jsdom --global
|
RUN npm install jest@30 jest-environment-jsdom@30 --global
|
||||||
WORKDIR /cpr
|
WORKDIR /cpr
|
||||||
COPY __test__/entrypoint.sh /entrypoint.sh
|
COPY __test__/entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
Vendored
+12
-691
@@ -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)) {
|
||||||
@@ -1576,11 +1576,12 @@ class GitHubHelper {
|
|||||||
const treeObjects = yield Promise.all(commit.changes.map((_a) => __awaiter(this, [_a], void 0, function* ({ path, mode, status, dstSha }) {
|
const treeObjects = yield Promise.all(commit.changes.map((_a) => __awaiter(this, [_a], void 0, function* ({ path, mode, status, dstSha }) {
|
||||||
if (mode === '160000') {
|
if (mode === '160000') {
|
||||||
// submodule
|
// submodule
|
||||||
core.info(`Creating tree object for submodule commit at '${path}'`);
|
core.info(`Creating tree object for submodule commit at '${path}' with status '${status}'`);
|
||||||
return {
|
return {
|
||||||
path,
|
path,
|
||||||
mode,
|
mode,
|
||||||
sha: dstSha,
|
// A deleted submodule has a null dstSha; a null sha deletes the entry
|
||||||
|
sha: status === 'D' ? null : dstSha,
|
||||||
type: 'commit'
|
type: 'commit'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1643,8 +1644,10 @@ class GitHubHelper {
|
|||||||
createOrUpdateRef(branchRepository, branch, newHead) {
|
createOrUpdateRef(branchRepository, branch, newHead) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const repository = this.parseRepository(branchRepository);
|
const repository = this.parseRepository(branchRepository);
|
||||||
const branchExists = yield this.octokit.rest.repos
|
// Check the git ref directly rather than using the branches API, which
|
||||||
.getBranch(Object.assign(Object.assign({}, repository), { branch: branch }))
|
// follows branch rename redirects and can return a different branch.
|
||||||
|
const branchExists = yield this.octokit.rest.git
|
||||||
|
.getRef(Object.assign(Object.assign({}, repository), { ref: `heads/${branch}` }))
|
||||||
.then(() => true, () => false);
|
.then(() => true, () => false);
|
||||||
if (branchExists) {
|
if (branchExists) {
|
||||||
core.info(`Branch ${branch} exists; Updating ref`);
|
core.info(`Branch ${branch} exists; Updating ref`);
|
||||||
@@ -29229,687 +29232,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:
|
||||||
@@ -36830,6 +36152,9 @@ function validateConcurrency(concurrency) {
|
|||||||
/******/ __nccwpck_require__.m = __webpack_modules__;
|
/******/ __nccwpck_require__.m = __webpack_modules__;
|
||||||
/******/
|
/******/
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
/******/ /* webpack/runtime/asset-relocator-loader */
|
||||||
|
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
||||||
|
/******/
|
||||||
/******/ /* webpack/runtime/create fake namespace object */
|
/******/ /* webpack/runtime/create fake namespace object */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
|
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
|
||||||
@@ -36910,10 +36235,6 @@ function validateConcurrency(concurrency) {
|
|||||||
/******/ };
|
/******/ };
|
||||||
/******/ })();
|
/******/ })();
|
||||||
/******/
|
/******/
|
||||||
/******/ /* webpack/runtime/compat */
|
|
||||||
/******/
|
|
||||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
|
||||||
/******/
|
|
||||||
/******/ /* webpack/runtime/require chunk loading */
|
/******/ /* webpack/runtime/require chunk loading */
|
||||||
/******/ (() => {
|
/******/ (() => {
|
||||||
/******/ // no baseURI
|
/******/ // no baseURI
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ module.exports = {
|
|||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
testEnvironment: 'node',
|
testEnvironment: 'node',
|
||||||
testMatch: ['**/*.test.ts'],
|
testMatch: ['**/*.test.ts'],
|
||||||
testRunner: 'jest-circus/runner',
|
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.ts$': 'ts-jest'
|
'^.+\\.ts$': 'ts-jest'
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+2438
-1659
File diff suppressed because it is too large.
Load diff
+10
-12
@@ -41,28 +41,26 @@
|
|||||||
"@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": "^30.0.0",
|
||||||
"@types/node": "^18.19.130",
|
"@types/node": "^18.19.130",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||||
"@typescript-eslint/parser": "^7.18.0",
|
"@typescript-eslint/parser": "^7.18.0",
|
||||||
"@vercel/ncc": "^0.38.4",
|
"@vercel/ncc": "^0.45.0",
|
||||||
"eslint": "^8.57.1",
|
"eslint": "^8.57.1",
|
||||||
"eslint-import-resolver-typescript": "^3.10.1",
|
"eslint-import-resolver-typescript": "^3.10.1",
|
||||||
"eslint-plugin-github": "^4.10.2",
|
"eslint-plugin-github": "^4.10.2",
|
||||||
"eslint-plugin-import": "^2.32.0",
|
"eslint-plugin-import": "^2.32.0",
|
||||||
"eslint-plugin-jest": "^27.9.0",
|
"eslint-plugin-jest": "^27.9.0",
|
||||||
"eslint-plugin-prettier": "^5.5.5",
|
"eslint-plugin-prettier": "^5.5.7",
|
||||||
"jest": "^29.7.0",
|
"jest": "^30.5.2",
|
||||||
"jest-circus": "^29.7.0",
|
"jest-environment-jsdom": "^30.5.2",
|
||||||
"jest-environment-jsdom": "^30.3.0",
|
"js-yaml": "^5.5.0",
|
||||||
"js-yaml": "^4.1.1",
|
"prettier": "^3.10.1",
|
||||||
"prettier": "^3.8.3",
|
"ts-jest": "^29.4.15",
|
||||||
"ts-jest": "^29.4.9",
|
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"undici": "^6.25.0"
|
"undici": "^6.29.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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)) {
|
||||||
|
|||||||
+10
-5
@@ -332,11 +332,14 @@ export class GitHubHelper {
|
|||||||
commit.changes.map(async ({path, mode, status, dstSha}) => {
|
commit.changes.map(async ({path, mode, status, dstSha}) => {
|
||||||
if (mode === '160000') {
|
if (mode === '160000') {
|
||||||
// submodule
|
// submodule
|
||||||
core.info(`Creating tree object for submodule commit at '${path}'`)
|
core.info(
|
||||||
|
`Creating tree object for submodule commit at '${path}' with status '${status}'`
|
||||||
|
)
|
||||||
return <TreeObject>{
|
return <TreeObject>{
|
||||||
path,
|
path,
|
||||||
mode,
|
mode,
|
||||||
sha: dstSha,
|
// A deleted submodule has a null dstSha; a null sha deletes the entry
|
||||||
|
sha: status === 'D' ? null : dstSha,
|
||||||
type: 'commit'
|
type: 'commit'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -435,10 +438,12 @@ export class GitHubHelper {
|
|||||||
newHead: string
|
newHead: string
|
||||||
) {
|
) {
|
||||||
const repository = this.parseRepository(branchRepository)
|
const repository = this.parseRepository(branchRepository)
|
||||||
const branchExists = await this.octokit.rest.repos
|
// Check the git ref directly rather than using the branches API, which
|
||||||
.getBranch({
|
// follows branch rename redirects and can return a different branch.
|
||||||
|
const branchExists = await this.octokit.rest.git
|
||||||
|
.getRef({
|
||||||
...repository,
|
...repository,
|
||||||
branch: branch
|
ref: `heads/${branch}`
|
||||||
})
|
})
|
||||||
.then(
|
.then(
|
||||||
() => true,
|
() => true,
|
||||||
|
|||||||
Reference in new issue
Block a user