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
7 changed files with 123 additions and 153 deletions

View File

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

View File

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

View File

@ -21,7 +21,7 @@ Create Pull Request action will:
- [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md) - [Concepts, guidelines and advanced usage](docs/concepts-guidelines.md)
- [Examples](docs/examples.md) - [Examples](docs/examples.md)
- [Updating to v7](docs/updating.md) - [Updating to v6](docs/updating.md)
- [Common issues](docs/common-issues.md) - [Common issues](docs/common-issues.md)
## Usage ## Usage
@ -246,7 +246,6 @@ Note that the repository must be checked out on a branch with a remote, it won't
uses: peter-evans/create-pull-request@v7 uses: peter-evans/create-pull-request@v7
``` ```
<!--
### Create a project card ### 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. 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.
@ -264,7 +263,6 @@ To create a project card for the pull request, pass the `pull-request-number` st
column-name: My column column-name: My column
issue-number: ${{ steps.cpr.outputs.pull-request-number }} issue-number: ${{ steps.cpr.outputs.pull-request-number }}
``` ```
-->
### Auto-merge ### Auto-merge

17
dist/index.js vendored
View File

@ -46,7 +46,6 @@ exports.buildBranchCommits = buildBranchCommits;
exports.createOrUpdateBranch = createOrUpdateBranch; exports.createOrUpdateBranch = createOrUpdateBranch;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const uuid_1 = __nccwpck_require__(5840); 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 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';
const FETCH_DEPTH_MARGIN = 10; 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 // Return true if the specified number of commits on branch1 and branch2 have a diff
function commitsHaveDiff(git, branch1, branch2, depth) { function commitsHaveDiff(git, branch1, branch2, depth) {
return __awaiter(this, void 0, void 0, function* () { 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. const diff1 = (yield git.exec(['diff', '--stat', `${branch1}..${branch1}~${depth}`])).stdout.trim();
// I've made this check optional for now because it was a fix for an edge case that is const diff2 = (yield git.exec(['diff', '--stat', `${branch2}..${branch2}~${depth}`])).stdout.trim();
// very rare, anyway. return diff1 !== diff2;
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) { function splitLines(multilineString) {

219
package-lock.json generated
View File

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

View File

@ -42,14 +42,14 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.12", "@types/jest": "^29.5.12",
"@types/node": "^18.19.48", "@types/node": "^18.19.46",
"@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.18.0", "@typescript-eslint/parser": "^7.17.0",
"@vercel/ncc": "^0.38.1", "@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.3", "eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-github": "^4.10.2", "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-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"jest": "^29.7.0", "jest": "^29.7.0",

View File

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