diff --git a/dist/index.js b/dist/index.js index ba9c04aaf..4a850830b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4966,8 +4966,12 @@ var glob = __webpack_require__(90); var io = __webpack_require__(436); // CONCATENATED MODULE: ./src/async-function.ts +// import { Octokit } from '@octokit/core' +// import { retry } from '@octokit/plugin-retry' const AsyncFunction = Object.getPrototypeOf(async () => null).constructor; function callAsyncFunction(args, source) { + console.log('args', args); + console.log('source', source); const fn = new AsyncFunction(...Object.keys(args), source); return fn(...Object.values(args)); } diff --git a/package-lock.json b/package-lock.json index 44a6597e7..0596ff2c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,8 @@ "@actions/io": "^1.1.1", "@octokit/core": "^3.5.1", "@octokit/plugin-paginate-rest": "^2.17.0", - "@octokit/plugin-rest-endpoint-methods": "^6.3.0" + "@octokit/plugin-rest-endpoint-methods": "^6.3.0", + "@octokit/plugin-retry": "^3.0.9" }, "devDependencies": { "@types/jest": "^27.0.2", @@ -1158,6 +1159,15 @@ "@octokit/openapi-types": "^13.1.0" } }, + "node_modules/@octokit/plugin-retry": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz", + "integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==", + "dependencies": { + "@octokit/types": "^6.0.3", + "bottleneck": "^2.15.3" + } + }, "node_modules/@octokit/request": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz", @@ -1803,6 +1813,11 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" }, + "node_modules/bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -7116,6 +7131,15 @@ } } }, + "@octokit/plugin-retry": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz", + "integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==", + "requires": { + "@octokit/types": "^6.0.3", + "bottleneck": "^2.15.3" + } + }, "@octokit/request": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz", @@ -7613,6 +7637,11 @@ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" }, + "bottleneck": { + "version": "2.19.5", + "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", diff --git a/package.json b/package.json index 88f5e96ca..87becc107 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@actions/glob": "^0.2.0", "@actions/io": "^1.1.1", "@octokit/core": "^3.5.1", + "@octokit/plugin-retry": "^3.0.9", "@octokit/plugin-paginate-rest": "^2.17.0", "@octokit/plugin-rest-endpoint-methods": "^6.3.0" }, @@ -54,4 +55,4 @@ "ts-jest": "^27.0.5", "typescript": "^4.3.5" } -} +} \ No newline at end of file diff --git a/src/async-function.ts b/src/async-function.ts index ba8e74963..246635f23 100644 --- a/src/async-function.ts +++ b/src/async-function.ts @@ -1,11 +1,15 @@ import * as core from '@actions/core' import * as exec from '@actions/exec' -import {Context} from '@actions/github/lib/context' -import {GitHub} from '@actions/github/lib/utils' +import { Context } from '@actions/github/lib/context' +import { GitHub } from '@actions/github/lib/utils' import * as glob from '@actions/glob' import * as io from '@actions/io' +// import { Octokit } from '@octokit/core' +// import { retry } from '@octokit/plugin-retry' const AsyncFunction = Object.getPrototypeOf(async () => null).constructor +// const MyOctokit = Octokit.plugin(retry); +// const octokit = new MyOctokit({ auth: "secret123" }); type AsyncFunctionArguments = { context: Context @@ -22,6 +26,8 @@ export function callAsyncFunction( args: AsyncFunctionArguments, source: string ): Promise { + console.log('args', args); + console.log('source', source); const fn = new AsyncFunction(...Object.keys(args), source) return fn(...Object.values(args)) }