Compare commits

..

69 Commits

Author SHA1 Message Date
c58bcf269b update major version 2024-08-30 15:13:17 +00:00
25f1937529 fix typo 2024-08-30 15:50:57 +01:00
2d4402547d add updating documentation 2024-08-30 15:48:19 +01:00
926a201444 fix edge case where changes are partially merged 2024-08-28 17:45:52 +01:00
ce190a9972 update readme about the permissions of the default token 2024-08-27 21:20:52 +01:00
9fc91d93e9 update docs 2024-08-27 21:20:51 +01:00
6c4c6cfe81 multipart tree creation 2024-08-27 21:20:51 +01:00
633a5a9752 use parent tree for base_tree 2024-08-27 21:20:51 +01:00
02efff68da use parent commit details in create commit 2024-08-27 21:20:51 +01:00
034fcb0bf3 pass base commit to push signed commits 2024-08-27 21:20:51 +01:00
42beb85339 parse empty commits 2024-08-27 21:20:51 +01:00
a3546365cd catch errors during blob creation for debugging 2024-08-27 21:20:51 +01:00
1e681e3226 update docs with blob size limit 2024-08-27 21:20:51 +01:00
8f92797560 convert to draft on branch updates when there is a diff with base 2024-08-27 21:20:50 +01:00
c64379e4f4 draft always-true 2024-08-27 21:20:50 +01:00
10454726b6 fix verified output when no commit signing is being used 2024-08-27 21:20:50 +01:00
1cd6df66ac check verification status of head commit when not known 2024-08-27 21:20:50 +01:00
32e97fc746 build branch commits when there is a diff with the base 2024-08-27 21:20:50 +01:00
2ba41ede85 update docs 2024-08-27 21:20:50 +01:00
942e5a917e fix doc 2024-08-27 21:20:50 +01:00
981b4699e5 update docs 2024-08-27 21:20:50 +01:00
4a0f9a8513 remove deprecated env output 2024-08-27 21:20:50 +01:00
c006a630f0 fix branch token input 2024-08-27 21:20:49 +01:00
1985abb7f4 rename git-token to branch-token 2024-08-27 21:20:49 +01:00
5294a5ed9d add maintainer-can-modify input 2024-08-27 21:20:49 +01:00
b793f780d4 use separate client for branch and pull operations 2024-08-27 21:20:49 +01:00
f5bdca7bbf output retryafter for secondary rate limit 2024-08-27 21:20:49 +01:00
59815b27ea default the operation output to none 2024-08-27 21:20:49 +01:00
eb6967ba69 fix head sha output 2024-08-27 21:20:49 +01:00
1fbc61676c log outputs 2024-08-27 21:20:48 +01:00
139c557742 output head sha and verified status 2024-08-27 21:20:48 +01:00
e572f56030 set default back to false 2024-08-27 21:20:48 +01:00
13fa7b0c66 add throttling 2024-08-27 21:20:48 +01:00
3cc54e847d update docs 2024-08-27 21:20:48 +01:00
0a565da02b fix capital letter 2024-08-27 21:20:48 +01:00
cc836600d9 update docs for commit signing 2024-08-27 21:20:48 +01:00
b7277ab0b4 update readme link 2024-08-27 21:20:48 +01:00
72cf0929ae remove unused code 2024-08-27 21:20:48 +01:00
53ed82a297 only build commits when feature enabled 2024-08-27 21:20:48 +01:00
3a6bc1b6c6 limit blob creation concurrency 2024-08-27 21:20:47 +01:00
219a33fe88 add executable mode file to test 2024-08-27 21:20:47 +01:00
384bd7f976 fix format and cleanup 2024-08-27 21:20:47 +01:00
4c77294175 debug commit verification 2024-08-27 21:20:47 +01:00
d94a826899 debug commit verification 2024-08-27 21:20:47 +01:00
0785201fba try fix base tree 2024-08-27 21:20:47 +01:00
63aac9338f force push 2024-08-27 21:20:47 +01:00
8605c43792 fix check for branch existence 2024-08-27 21:20:46 +01:00
0c8901cc91 try rest api route 2024-08-27 21:20:46 +01:00
6b1053d0d8 use source mode for deleted files 2024-08-27 21:20:46 +01:00
b2a409b0a3 build branch commits 2024-08-27 21:20:46 +01:00
ec02db74e9 fix format 2024-08-27 21:20:46 +01:00
029414bc07 add function to get commit detail 2024-08-27 21:20:46 +01:00
9cd16daf06 build file changes even when there is no diff 2024-08-27 21:20:46 +01:00
6c5dc224d1 refactor graphql code into github helper class 2024-08-27 21:20:45 +01:00
9c7a97affd add build file changes test for binary files 2024-08-27 21:20:45 +01:00
c29821586c add tests for building file changes 2024-08-27 21:20:45 +01:00
9d7ad21b2f Try refactor of file changes 2024-08-27 21:20:45 +01:00
f09d6ed256 remove commented code 2024-08-27 21:20:45 +01:00
d88643b9ac try to fix head repo 2024-08-27 21:20:45 +01:00
184d576617 fix filepath when using path input 2024-08-27 21:20:45 +01:00
396429353a disable linter for debug code 2024-08-27 21:20:44 +01:00
efd26f0872 debug payload without contents 2024-08-27 21:20:44 +01:00
bc73bc700a read to buffer not string and use non-legacy method to base64 2024-08-27 21:20:44 +01:00
8f257d093e add debug lines 2024-08-27 21:20:44 +01:00
7ccbe5d7c3 sign commits by default for testing 2024-08-27 21:20:44 +01:00
014f5c1fb1 shift setting the base to before the push 2024-08-27 21:20:44 +01:00
4cf9647c0e fix eslint and lint errors 2024-08-27 21:20:44 +01:00
8a55f622b6 formatting 2024-08-27 21:20:16 +01:00
744c8ceb5d Add support for signed commits (#3055) 2024-08-27 21:20:15 +01:00
10 changed files with 157 additions and 183 deletions

View File

@ -124,7 +124,7 @@ jobs:
name: dist
path: dist
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
commit-message: 'build: update distribution'

View File

@ -11,8 +11,8 @@ on:
type: choice
description: The major version tag to update
options:
- v5
- v6
- v7
jobs:
tag:

View File

@ -21,7 +21,7 @@ Create Pull Request action will:
- [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md)
- [Examples](docs/examples.md)
- [Updating to v7](docs/updating.md)
- [Updating to v6](docs/updating.md)
- [Common issues](docs/common-issues.md)
## Usage
@ -246,6 +246,24 @@ Note that the repository must be checked out on a branch with a remote, it won't
uses: peter-evans/create-pull-request@v7
```
### Create a project card
To create a project card for the pull request, pass the `pull-request-number` step output to [create-or-update-project-card](https://github.com/peter-evans/create-or-update-project-card) action.
```yml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
- name: Create or Update Project Card
if: ${{ steps.cpr.outputs.pull-request-number }}
uses: peter-evans/create-or-update-project-card@v2
with:
project-name: My project
column-name: My column
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
```
### Auto-merge
Auto-merge can be enabled on a pull request allowing it to be automatically merged once requirements have been satisfied.

View File

@ -19,17 +19,14 @@ git clone git://127.0.0.1/repos/test-base.git /git/local/repos/test-base
cd /git/local/repos/test-base
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
echo "#test-base" > README_TEMP.md
echo "#test-base" > README.md
git add .
git commit -m "initial commit"
git commit --allow-empty -m "empty commit for tests"
echo "#test-base :sparkles:" > README_TEMP.md
echo "#test-base :sparkles:" > README.md
git add .
git commit -m "add sparkles" -m "Change description:
- updates README_TEMP.md to add sparkles to the title"
mv README_TEMP.md README.md
git add .
git commit -m "rename readme"
- updates README.md to add sparkles to the title"
git push -u
git log -1 --pretty=oneline
git config --global --unset user.email

View File

@ -11,15 +11,14 @@ describe('git-command-manager integration tests', () => {
})
it('tests getCommit', async () => {
const initialCommit = await git.getCommit('HEAD^^^')
const emptyCommit = await git.getCommit('HEAD^^')
const modifiedCommit = await git.getCommit('HEAD^')
const initialCommit = await git.getCommit('HEAD^^')
const emptyCommit = await git.getCommit('HEAD^')
const headCommit = await git.getCommit('HEAD')
expect(initialCommit.subject).toEqual('initial commit')
expect(initialCommit.signed).toBeFalsy()
expect(initialCommit.changes).toEqual([
{mode: '100644', status: 'A', path: 'README_TEMP.md'}
{mode: '100644', status: 'A', path: 'README.md'}
])
expect(emptyCommit.subject).toEqual('empty commit for tests')
@ -28,19 +27,11 @@ describe('git-command-manager integration tests', () => {
expect(emptyCommit.signed).toBeFalsy()
expect(emptyCommit.changes).toEqual([])
expect(modifiedCommit.subject).toEqual('add sparkles')
expect(modifiedCommit.parents[0]).toEqual(emptyCommit.sha)
expect(modifiedCommit.signed).toBeFalsy()
expect(modifiedCommit.changes).toEqual([
{mode: '100644', status: 'M', path: 'README_TEMP.md'}
])
expect(headCommit.subject).toEqual('rename readme')
expect(headCommit.parents[0]).toEqual(modifiedCommit.sha)
expect(headCommit.subject).toEqual('add sparkles')
expect(headCommit.parents[0]).toEqual(emptyCommit.sha)
expect(headCommit.signed).toBeFalsy()
expect(headCommit.changes).toEqual([
{mode: '100644', status: 'A', path: 'README.md'},
{mode: '100644', status: 'D', path: 'README_TEMP.md'}
{mode: '100644', status: 'M', path: 'README.md'}
])
})
})

15
dist/index.js vendored
View File

@ -46,7 +46,6 @@ exports.buildBranchCommits = buildBranchCommits;
exports.createOrUpdateBranch = createOrUpdateBranch;
const core = __importStar(__nccwpck_require__(2186));
const uuid_1 = __nccwpck_require__(5840);
const utils = __importStar(__nccwpck_require__(918));
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 FETCH_DEPTH_MARGIN = 10;
@ -137,19 +136,9 @@ function isEven(git, branch1, branch2) {
// Return true if the specified number of commits on branch1 and branch2 have a diff
function commitsHaveDiff(git, branch1, branch2, depth) {
return __awaiter(this, void 0, void 0, function* () {
// Some action use cases lead to the depth being a very large number and the diff fails.
// I've made this check optional for now because it was a fix for an edge case that is
// very rare, anyway.
try {
const diff1 = (yield git.exec(['diff', '--stat', `${branch1}..${branch1}~${depth}`])).stdout.trim();
const diff2 = (yield git.exec(['diff', '--stat', `${branch2}..${branch2}~${depth}`])).stdout.trim();
return diff1 !== diff2;
}
catch (error) {
core.info('Failed optional check of commits diff; Skipping.');
core.debug(utils.getErrorMessage(error));
return false;
}
});
}
function splitLines(multilineString) {
@ -745,8 +734,6 @@ class GitCommandManager {
'show',
'--raw',
'--cc',
'--no-renames',
'--no-abbrev',
`--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
ref
]);
@ -762,7 +749,7 @@ class GitCommandManager {
subject: detailLines[4],
body: detailLines.slice(5, endOfBodyIndex).join('\n'),
changes: lines.slice(endOfBodyIndex + 2, -1).map(line => {
const change = line.match(/^:(\d{6}) (\d{6}) \w{40} \w{40} ([AMD])\s+(.*)$/);
const change = line.match(/^:(\d{6}) (\d{6}) \w{7} \w{7} ([AMD])\s+(.*)$/);
if (change) {
return {
mode: change[3] === 'D' ? change[1] : change[2],

227
package-lock.json generated
View File

@ -22,14 +22,14 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^18.19.50",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@types/node": "^18.19.46",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.2.1",
"jest": "^29.7.0",
@ -38,7 +38,7 @@
"js-yaml": "^4.1.0",
"prettier": "^3.3.3",
"ts-jest": "^29.2.5",
"typescript": "^5.6.2"
"typescript": "^5.5.4"
}
},
"node_modules/@actions/core": {
@ -1413,12 +1413,6 @@
"url": "https://opencollective.com/unts"
}
},
"node_modules/@rtsao/scc": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
"integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==",
"dev": true
},
"node_modules/@sinclair/typebox": {
"version": "0.27.8",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
@ -1560,9 +1554,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "18.19.50",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz",
"integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==",
"version": "18.19.46",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.46.tgz",
"integrity": "sha512-vnRgMS7W6cKa1/0G3/DTtQYpVrZ8c0Xm6UkLaVFrb9jtcVC3okokW09Ki1Qdrj9ISokszD69nY4WDLRlvHlhAA==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
@ -1602,16 +1596,16 @@
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz",
"integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.17.0.tgz",
"integrity": "sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "7.18.0",
"@typescript-eslint/type-utils": "7.18.0",
"@typescript-eslint/utils": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0",
"@typescript-eslint/scope-manager": "7.17.0",
"@typescript-eslint/type-utils": "7.17.0",
"@typescript-eslint/utils": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0",
"graphemer": "^1.4.0",
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
@ -1635,13 +1629,13 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz",
"integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz",
"integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0"
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1652,9 +1646,9 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz",
"integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz",
"integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==",
"dev": true,
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1665,13 +1659,13 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz",
"integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz",
"integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0",
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -1693,15 +1687,15 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz",
"integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.17.0.tgz",
"integrity": "sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "7.18.0",
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/typescript-estree": "7.18.0"
"@typescript-eslint/scope-manager": "7.17.0",
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/typescript-estree": "7.17.0"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1715,12 +1709,12 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz",
"integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz",
"integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/types": "7.17.0",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {
@ -1756,15 +1750,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz",
"integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.17.0.tgz",
"integrity": "sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "7.18.0",
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/typescript-estree": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0",
"@typescript-eslint/scope-manager": "7.17.0",
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/typescript-estree": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0",
"debug": "^4.3.4"
},
"engines": {
@ -1784,13 +1778,13 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz",
"integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz",
"integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0"
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1801,9 +1795,9 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz",
"integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz",
"integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==",
"dev": true,
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1814,13 +1808,13 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz",
"integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz",
"integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0",
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -1842,12 +1836,12 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz",
"integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz",
"integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/types": "7.17.0",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {
@ -1900,13 +1894,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz",
"integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz",
"integrity": "sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA==",
"dev": true,
"dependencies": {
"@typescript-eslint/typescript-estree": "7.18.0",
"@typescript-eslint/utils": "7.18.0",
"@typescript-eslint/typescript-estree": "7.17.0",
"@typescript-eslint/utils": "7.17.0",
"debug": "^4.3.4",
"ts-api-utils": "^1.3.0"
},
@ -1927,13 +1921,13 @@
}
},
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz",
"integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz",
"integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0"
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1944,9 +1938,9 @@
}
},
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz",
"integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz",
"integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==",
"dev": true,
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1957,13 +1951,13 @@
}
},
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz",
"integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz",
"integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/visitor-keys": "7.18.0",
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/visitor-keys": "7.17.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -1985,15 +1979,15 @@
}
},
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz",
"integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.17.0.tgz",
"integrity": "sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "7.18.0",
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/typescript-estree": "7.18.0"
"@typescript-eslint/scope-manager": "7.17.0",
"@typescript-eslint/types": "7.17.0",
"@typescript-eslint/typescript-estree": "7.17.0"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -2007,12 +2001,12 @@
}
},
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz",
"integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==",
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz",
"integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.18.0",
"@typescript-eslint/types": "7.17.0",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {
@ -3623,9 +3617,9 @@
}
},
"node_modules/eslint-module-utils": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.9.0.tgz",
"integrity": "sha512-McVbYmwA3NEKwRQY5g4aWMdcZE5xZxV8i8l7CqJSrameuGSQJtSWaL/LxTEzSKKaCcOhlpDR8XEfYXWPrdo/ZQ==",
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.2.tgz",
"integrity": "sha512-3XnC5fDyc8M4J2E8pt8pmSVRX2M+5yWMCfI/kDZwauQeFgzQOuhcRBFKjTeJagqgk4sFKxe1mvNVnaWwImx/Tg==",
"dev": true,
"dependencies": {
"debug": "^3.2.7"
@ -3744,27 +3738,26 @@
}
},
"node_modules/eslint-plugin-import": {
"version": "2.30.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.30.0.tgz",
"integrity": "sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==",
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz",
"integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==",
"dev": true,
"dependencies": {
"@rtsao/scc": "^1.1.0",
"array-includes": "^3.1.8",
"array.prototype.findlastindex": "^1.2.5",
"array-includes": "^3.1.7",
"array.prototype.findlastindex": "^1.2.3",
"array.prototype.flat": "^1.3.2",
"array.prototype.flatmap": "^1.3.2",
"debug": "^3.2.7",
"doctrine": "^2.1.0",
"eslint-import-resolver-node": "^0.3.9",
"eslint-module-utils": "^2.9.0",
"hasown": "^2.0.2",
"is-core-module": "^2.15.1",
"eslint-module-utils": "^2.8.0",
"hasown": "^2.0.0",
"is-core-module": "^2.13.1",
"is-glob": "^4.0.3",
"minimatch": "^3.1.2",
"object.fromentries": "^2.0.8",
"object.groupby": "^1.0.3",
"object.values": "^1.2.0",
"object.fromentries": "^2.0.7",
"object.groupby": "^1.0.1",
"object.values": "^1.1.7",
"semver": "^6.3.1",
"tsconfig-paths": "^3.15.0"
},
@ -4833,9 +4826,9 @@
}
},
"node_modules/is-core-module": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz",
"integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==",
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz",
"integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==",
"dev": true,
"dependencies": {
"hasown": "^2.0.2"
@ -7756,9 +7749,9 @@
}
},
"node_modules/typescript": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz",
"integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==",
"version": "5.5.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz",
"integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",
"dev": true,
"bin": {
"tsc": "bin/tsc",

View File

@ -42,14 +42,14 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^18.19.50",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@types/node": "^18.19.46",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.2.1",
"jest": "^29.7.0",
@ -58,6 +58,6 @@
"js-yaml": "^4.1.0",
"prettier": "^3.3.3",
"ts-jest": "^29.2.5",
"typescript": "^5.6.2"
"typescript": "^5.5.4"
}
}

View File

@ -1,7 +1,6 @@
import * as core from '@actions/core'
import {GitCommandManager, Commit} from './git-command-manager'
import {v4 as uuidv4} from 'uuid'
import * as utils from './utils'
const CHERRYPICK_EMPTY =
'The previous cherry-pick is now empty, possibly due to conflict resolution.'
@ -132,10 +131,6 @@ async function commitsHaveDiff(
branch2: string,
depth: number
): Promise<boolean> {
// Some action use cases lead to the depth being a very large number and the diff fails.
// I've made this check optional for now because it was a fix for an edge case that is
// very rare, anyway.
try {
const diff1 = (
await git.exec(['diff', '--stat', `${branch1}..${branch1}~${depth}`])
).stdout.trim()
@ -143,11 +138,6 @@ async function commitsHaveDiff(
await git.exec(['diff', '--stat', `${branch2}..${branch2}~${depth}`])
).stdout.trim()
return diff1 !== diff2
} catch (error) {
core.info('Failed optional check of commits diff; Skipping.')
core.debug(utils.getErrorMessage(error))
return false
}
}
function splitLines(multilineString: string): string[] {

View File

@ -159,8 +159,6 @@ export class GitCommandManager {
'show',
'--raw',
'--cc',
'--no-renames',
'--no-abbrev',
`--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
ref
])
@ -178,7 +176,7 @@ export class GitCommandManager {
body: detailLines.slice(5, endOfBodyIndex).join('\n'),
changes: lines.slice(endOfBodyIndex + 2, -1).map(line => {
const change = line.match(
/^:(\d{6}) (\d{6}) \w{40} \w{40} ([AMD])\s+(.*)$/
/^:(\d{6}) (\d{6}) \w{7} \w{7} ([AMD])\s+(.*)$/
)
if (change) {
return {