From 23abc0e983aba0258c4667f852c4cc88cfc03a90 Mon Sep 17 00:00:00 2001 From: Tim Gymnich Date: Thu, 30 May 2024 22:10:55 +0200 Subject: [PATCH] remove retry --- lib/main.js | 10 +--------- lib/main.js.map | 2 +- src/main.ts | 10 +--------- tsconfig.json | 4 ++-- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/lib/main.js b/lib/main.js index a24773e5..09722faf 100644 --- a/lib/main.js +++ b/lib/main.js @@ -26,10 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); const core = __importStar(require("@actions/core")); const Github = __importStar(require("@actions/github")); const rest_1 = require("@octokit/rest"); -const plugin_retry_1 = require("@octokit/plugin-retry"); const token = core.getInput('token', { required: true }); const context = Github.context; -const MyOctokit = rest_1.Octokit.plugin(plugin_retry_1.retry); async function run() { let owner = core.getInput('owner', { required: false }) || context.repo.owner; let repo = core.getInput('repo', { required: false }) || context.repo.repo; @@ -43,13 +41,7 @@ async function run() { const autoMerge = core.getBooleanInput('auto_merge', { required: false }); const retries = parseInt(core.getInput('retries', { required: false })) ?? 4; const retryAfter = parseInt(core.getInput('retry_after', { required: false })) ?? 60; - const octokit = new MyOctokit({ - auth: token, - request: { - retries, - retryAfter, - }, - }); + const octokit = new rest_1.Octokit({ auth: token }); let r = await octokit.rest.repos.get({ owner, repo, diff --git a/lib/main.js.map b/lib/main.js.map index 73a2157b..8a74fcba 100644 --- a/lib/main.js.map +++ b/lib/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,wDAAyC;AACzC,wCAAwC;AACxC,wDAA8C;AAE9C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACzD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AAC/B,MAAM,SAAS,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AC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,mCAAmC,CAAC,EAAE,CAAC;YAC3H,uBAAuB;YACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,IAAI,CAAC,SAAS,CAAC,2CAA2C,KAAK,IAAI,OAAO,EAAE,CAAC,CAAC;YAChF,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,IAAI,OAAO,CAAE,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,CAAE,CAAC;AACjE,CAAC;AAED,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index f8549800..b6228266 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,11 +1,9 @@ import * as core from '@actions/core'; import * as Github from '@actions/github' import { Octokit } from "@octokit/rest"; -import { retry } from "@octokit/plugin-retry"; const token = core.getInput('token', { required: true }); const context = Github.context; -const MyOctokit = Octokit.plugin(retry); async function run() { let owner = core.getInput('owner', { required: false }) || context.repo.owner; @@ -21,13 +19,7 @@ async function run() { const retries = parseInt(core.getInput('retries', { required: false })) ?? 4; const retryAfter = parseInt(core.getInput('retry_after', { required: false })) ?? 60; - const octokit = new MyOctokit({ - auth: token, - request: { - retries, - retryAfter, - }, - }); + const octokit = new Octokit({auth: token}); let r = await octokit.rest.repos.get({ owner, diff --git a/tsconfig.json b/tsconfig.json index 3ba08338..c1fd9d41 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,9 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "target": "ES2022", - "module": "node16", + "module": "nodenext", "rootDir": "./src", - "moduleResolution": "node16", + "moduleResolution": "nodenext", "baseUrl": "./", "sourceMap": true, "outDir": "./lib",