mirror of
https://github.com/peter-evans/create-pull-request.git
synced 2026-12-04 04:59:04 +00:00
Compare commits
1
Commits
main
..
replace_uuid
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ef8501772 |
No files matched your search
@@ -5,8 +5,6 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: "monthly"
|
interval: "monthly"
|
||||||
day: "tuesday"
|
day: "tuesday"
|
||||||
cooldown:
|
|
||||||
default-days: 3
|
|
||||||
labels:
|
labels:
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
groups:
|
groups:
|
||||||
@@ -19,8 +17,6 @@ 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@a660677d5469627102a1c1e11409dd063606628d # v3.0.0
|
- uses: peter-evans/enable-pull-request-automerge@v3
|
||||||
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
- uses: actions/setup-node@v6
|
||||||
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@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
- uses: actions/upload-artifact@v7
|
||||||
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
- uses: actions/checkout@v6
|
||||||
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@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
uses: actions/download-artifact@v8
|
||||||
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@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
uses: actions/download-artifact@v8
|
||||||
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@a192af8d70f2d49c49643134605c3b73d4f80fae # v3.0.1
|
uses: peter-evans/close-pull@v3
|
||||||
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@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
|
uses: peter-evans/find-comment@v4
|
||||||
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@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
- uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist
|
path: dist
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@3ffccacd46053766916f087ce41d627c0b8cf2d1 # v8.1.3
|
uses: peter-evans/create-pull-request@v8
|
||||||
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- 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@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
|
uses: peter-evans/create-or-update-comment@v5
|
||||||
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@9bdcd7914ec1b75590b790b844aa3b8eee7c683a # v5.0.2
|
uses: peter-evans/slash-command-dispatch@v5
|
||||||
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -27,13 +27,6 @@ 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: |
|
run: git tag -f ${{ github.event.inputs.main_version }} ${{ github.event.inputs.target }}
|
||||||
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 "${INPUT_MAIN_VERSION}" --force
|
run: git push origin ${{ github.event.inputs.main_version }} --force
|
||||||
env:
|
|
||||||
INPUT_MAIN_VERSION: ${{ github.event.inputs.main_version }}
|
|
||||||
@@ -1,182 +0,0 @@
|
|||||||
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@30 jest-environment-jsdom@30 --global
|
RUN npm install jest jest-environment-jsdom --global
|
||||||
WORKDIR /cpr
|
WORKDIR /cpr
|
||||||
COPY __test__/entrypoint.sh /entrypoint.sh
|
COPY __test__/entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
Vendored
+8
-10
@@ -1576,12 +1576,11 @@ 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}' with status '${status}'`);
|
core.info(`Creating tree object for submodule commit at '${path}'`);
|
||||||
return {
|
return {
|
||||||
path,
|
path,
|
||||||
mode,
|
mode,
|
||||||
// A deleted submodule has a null dstSha; a null sha deletes the entry
|
sha: dstSha,
|
||||||
sha: status === 'D' ? null : dstSha,
|
|
||||||
type: 'commit'
|
type: 'commit'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1644,10 +1643,8 @@ 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);
|
||||||
// Check the git ref directly rather than using the branches API, which
|
const branchExists = yield this.octokit.rest.repos
|
||||||
// follows branch rename redirects and can return a different branch.
|
.getBranch(Object.assign(Object.assign({}, repository), { branch: 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`);
|
||||||
@@ -36152,9 +36149,6 @@ 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__);
|
||||||
@@ -36235,6 +36229,10 @@ 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
+1620
-2399
File diff suppressed because it is too large.
Load diff
+10
-9
@@ -44,23 +44,24 @@
|
|||||||
"p-limit": "^6.2.0"
|
"p-limit": "^6.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^29.5.14",
|
||||||
"@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.45.0",
|
"@vercel/ncc": "^0.38.4",
|
||||||
"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.7",
|
"eslint-plugin-prettier": "^5.5.5",
|
||||||
"jest": "^30.5.2",
|
"jest": "^29.7.0",
|
||||||
"jest-environment-jsdom": "^30.5.2",
|
"jest-circus": "^29.7.0",
|
||||||
"js-yaml": "^5.5.0",
|
"jest-environment-jsdom": "^30.3.0",
|
||||||
"prettier": "^3.10.1",
|
"js-yaml": "^4.1.1",
|
||||||
"ts-jest": "^29.4.15",
|
"prettier": "^3.8.3",
|
||||||
|
"ts-jest": "^29.4.9",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"undici": "^6.29.1"
|
"undici": "^6.25.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
-10
@@ -332,14 +332,11 @@ 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(
|
core.info(`Creating tree object for submodule commit at '${path}'`)
|
||||||
`Creating tree object for submodule commit at '${path}' with status '${status}'`
|
|
||||||
)
|
|
||||||
return <TreeObject>{
|
return <TreeObject>{
|
||||||
path,
|
path,
|
||||||
mode,
|
mode,
|
||||||
// A deleted submodule has a null dstSha; a null sha deletes the entry
|
sha: dstSha,
|
||||||
sha: status === 'D' ? null : dstSha,
|
|
||||||
type: 'commit'
|
type: 'commit'
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -438,12 +435,10 @@ export class GitHubHelper {
|
|||||||
newHead: string
|
newHead: string
|
||||||
) {
|
) {
|
||||||
const repository = this.parseRepository(branchRepository)
|
const repository = this.parseRepository(branchRepository)
|
||||||
// Check the git ref directly rather than using the branches API, which
|
const branchExists = await this.octokit.rest.repos
|
||||||
// follows branch rename redirects and can return a different branch.
|
.getBranch({
|
||||||
const branchExists = await this.octokit.rest.git
|
|
||||||
.getRef({
|
|
||||||
...repository,
|
...repository,
|
||||||
ref: `heads/${branch}`
|
branch: branch
|
||||||
})
|
})
|
||||||
.then(
|
.then(
|
||||||
() => true,
|
() => true,
|
||||||
|
|||||||
Reference in new issue
Block a user