diff --git a/bun.lock b/bun.lock index 2719b3e66..2979088ec 100644 --- a/bun.lock +++ b/bun.lock @@ -18,7 +18,7 @@ "simple-git": "3.36.0", }, "devDependencies": { - "@octokit/webhooks-types": "7.6.1", + "@octokit/openapi-webhooks-types": "12.1.0", "@total-typescript/ts-reset": "0.6.1", "@types/bluebird": "3.5.42", "@types/bun": "1.4.1", @@ -99,6 +99,8 @@ "@octokit/openapi-types": ["@octokit/openapi-types@28.0.0", "", {}, "sha512-0rFyLuyHvIj6uuZWuDslxkowFYdPXoNIkeAv4b27dzm2Tf4vGWXnPsMcxs7d65kLdMERgP3wc1AEPlqMz8e1cQ=="], + "@octokit/openapi-webhooks-types": ["@octokit/openapi-webhooks-types@12.1.0", "", {}, "sha512-WiuzhOsiOvb7W3Pvmhf8d2C6qaLHXrWiLBP4nJ/4kydu+wpagV5Fkz9RfQwV2afYzv3PB+3xYgp4mAdNGjDprA=="], + "@octokit/plugin-paginate-rest": ["@octokit/plugin-paginate-rest@14.0.0", "", { "dependencies": { "@octokit/types": "^16.0.0" }, "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw=="], "@octokit/plugin-rest-endpoint-methods": ["@octokit/plugin-rest-endpoint-methods@17.0.0", "", { "dependencies": { "@octokit/types": "^16.0.0" }, "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw=="], @@ -111,8 +113,6 @@ "@octokit/types": ["@octokit/types@17.0.0", "", { "dependencies": { "@octokit/openapi-types": "^28.0.0" } }, "sha512-ByP1v7YL5SMveFPP7+sj0/ZuWCOOg/Chs4NafOMpq6WNIM/hdGY0S7C0TCGDBWu1aGmOxmUIhMx3cO+IdwYZ1Q=="], - "@octokit/webhooks-types": ["@octokit/webhooks-types@7.6.1", "", {}, "sha512-S8u2cJzklBC0FgTwWVLaM8tMrDuDMVE4xiTK4EYXM9GntyvrdbSoxqDQa+Fh57CCNApyIpyeqPhhFEmHPfrXgw=="], - "@simple-git/args-pathspec": ["@simple-git/args-pathspec@1.0.3", "", {}, "sha512-ngJMaHlsWDTfjyq9F3VIQ8b7NXbBLq5j9i5bJ6XLYtD6qlDXT7fdKY2KscWWUF8t18xx052Y/PUO1K1TRc9yKA=="], "@simple-git/argv-parser": ["@simple-git/argv-parser@1.1.0", "", { "dependencies": { "@simple-git/args-pathspec": "^1.0.3" } }, "sha512-sUKOu2lb5vGIWADNNLpscyj07DAeQZU3KLbnE2Tj53tW6BbDQKMly2CCfnR4oYzqtRELCPWfwaPg+Q0T8qfKBg=="], diff --git a/dist/helpers/create-batched-commit-message.js.map b/dist/helpers/create-batched-commit-message.js.map index e8b897f66..570bc045f 100644 --- a/dist/helpers/create-batched-commit-message.js.map +++ b/dist/helpers/create-batched-commit-message.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": ["../src/helpers/create-batched-commit-message.ts"], "sourcesContent": [ - "/*\nCopyright 2021 Expedia, Inc.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttps://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { context } from '@actions/github';\nimport { error } from '@actions/core';\nimport { PushEvent } from '@octokit/webhooks-types';\n\nexport const createBatchedCommitMessage = () => {\n const eventPayload = context.payload as PushEvent;\n if (!('commits' in eventPayload)) {\n error('No commits found in the event payload.');\n return;\n }\n\n const maxCharactersPerMessage = 50;\n\n return eventPayload.commits\n .map(commit => {\n const prNumberWithParens = commit.message.match(/\\(#(\\d+)\\)/)?.[0] ?? '';\n const messageWithoutPrNumber = commit.message.replace(prNumberWithParens, '').split('\\n')[0]?.trim() ?? '';\n const truncatedMessage = messageWithoutPrNumber.slice(0, maxCharactersPerMessage);\n const ellipses = truncatedMessage.length < messageWithoutPrNumber.length ? '...' : '';\n return `${truncatedMessage}${ellipses} ${prNumberWithParens}`;\n })\n .join(' and ');\n};\n" + "/*\nCopyright 2021 Expedia, Inc.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttps://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { context } from '@actions/github';\nimport { error } from '@actions/core';\nimport { components } from '@octokit/openapi-webhooks-types';\n\ntype PushEvent = components['schemas']['webhook-push'];\n\nexport const createBatchedCommitMessage = () => {\n const eventPayload = context.payload as PushEvent;\n if (!('commits' in eventPayload)) {\n error('No commits found in the event payload.');\n return;\n }\n\n const maxCharactersPerMessage = 50;\n\n return eventPayload.commits\n .map(commit => {\n const prNumberWithParens = commit.message.match(/\\(#(\\d+)\\)/)?.[0] ?? '';\n const messageWithoutPrNumber = commit.message.replace(prNumberWithParens, '').split('\\n')[0]?.trim() ?? '';\n const truncatedMessage = messageWithoutPrNumber.slice(0, maxCharactersPerMessage);\n const ellipses = truncatedMessage.length < messageWithoutPrNumber.length ? '...' : '';\n return `${truncatedMessage}${ellipses} ${prNumberWithParens}`;\n })\n .join(' and ');\n};\n" ], - "mappings": ";;;;;;;;;AAiBO,IAAM,6BAA6B,MAAM;AAAA,EAC9C,MAAM,eAAe,QAAQ;AAAA,EAC7B,IAAI,EAAE,aAAa,eAAe;AAAA,IAChC,MAAM,wCAAwC;AAAA,IAC9C;AAAA,EACF;AAAA,EAEA,MAAM,0BAA0B;AAAA,EAEhC,OAAO,aAAa,QACjB,IAAI,YAAU;AAAA,IACb,MAAM,qBAAqB,OAAO,QAAQ,MAAM,YAAY,IAAI,MAAM;AAAA,IACtE,MAAM,yBAAyB,OAAO,QAAQ,QAAQ,oBAAoB,EAAE,EAAE,MAAM;AAAA,CAAI,EAAE,IAAI,KAAK,KAAK;AAAA,IACxG,MAAM,mBAAmB,uBAAuB,MAAM,GAAG,uBAAuB;AAAA,IAChF,MAAM,WAAW,iBAAiB,SAAS,uBAAuB,SAAS,QAAQ;AAAA,IACnF,OAAO,GAAG,mBAAmB,YAAY;AAAA,GAC1C,EACA,KAAK,OAAO;AAAA;", + "mappings": ";;;;;;;;;AAmBO,IAAM,6BAA6B,MAAM;AAAA,EAC9C,MAAM,eAAe,QAAQ;AAAA,EAC7B,IAAI,EAAE,aAAa,eAAe;AAAA,IAChC,MAAM,wCAAwC;AAAA,IAC9C;AAAA,EACF;AAAA,EAEA,MAAM,0BAA0B;AAAA,EAEhC,OAAO,aAAa,QACjB,IAAI,YAAU;AAAA,IACb,MAAM,qBAAqB,OAAO,QAAQ,MAAM,YAAY,IAAI,MAAM;AAAA,IACtE,MAAM,yBAAyB,OAAO,QAAQ,QAAQ,oBAAoB,EAAE,EAAE,MAAM;AAAA,CAAI,EAAE,IAAI,KAAK,KAAK;AAAA,IACxG,MAAM,mBAAmB,uBAAuB,MAAM,GAAG,uBAAuB;AAAA,IAChF,MAAM,WAAW,iBAAiB,SAAS,uBAAuB,SAAS,QAAQ;AAAA,IACnF,OAAO,GAAG,mBAAmB,YAAY;AAAA,GAC1C,EACA,KAAK,OAAO;AAAA;", "debugId": "7D43A772456337F364756E2164756E21", "names": [] } \ No newline at end of file diff --git a/package.json b/package.json index 905d83505..7d1375626 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "simple-git": "3.36.0" }, "devDependencies": { - "@octokit/webhooks-types": "7.6.1", + "@octokit/openapi-webhooks-types": "12.1.0", "@total-typescript/ts-reset": "0.6.1", "@types/bluebird": "3.5.42", "@types/bun": "1.4.1", diff --git a/src/helpers/create-batched-commit-message.ts b/src/helpers/create-batched-commit-message.ts index ded11caa2..ae905fcae 100644 --- a/src/helpers/create-batched-commit-message.ts +++ b/src/helpers/create-batched-commit-message.ts @@ -13,7 +13,9 @@ limitations under the License. import { context } from '@actions/github'; import { error } from '@actions/core'; -import { PushEvent } from '@octokit/webhooks-types'; +import { components } from '@octokit/openapi-webhooks-types'; + +type PushEvent = components['schemas']['webhook-push']; export const createBatchedCommitMessage = () => { const eventPayload = context.payload as PushEvent;