Skip to content

Commit 3b7b527

Browse files
committed
fix: octokit retry
1 parent b871b4f commit 3b7b527

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

package-lock.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@actions/exec": "^1.1.1",
3030
"@actions/github": "^6.0.0",
3131
"@actions/http-client": "^2.2.3",
32+
"@octokit/plugin-retry": "^6.1.0",
3233
"@actions/tool-cache": "^2.0.2",
3334
"@types/node": "^22.13.10",
3435
"@types/semver": "^7.5.8",

src/patch.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as core from "@actions/core"
22
import * as github from "@actions/github"
33
import { Context } from "@actions/github/lib/context"
4+
import * as pluginRetry from "@octokit/plugin-retry"
45
import fs from "fs"
56
import path from "path"
67
import { dir } from "tmp"
@@ -43,7 +44,7 @@ async function fetchPullRequestPatch(ctx: Context): Promise<string> {
4344
return ``
4445
}
4546

46-
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }))
47+
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }), {}, pluginRetry.retry)
4748

4849
let patch: string
4950
try {
@@ -81,7 +82,7 @@ async function fetchPullRequestPatch(ctx: Context): Promise<string> {
8182
}
8283

8384
async function fetchPushPatch(ctx: Context): Promise<string> {
84-
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }))
85+
const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }), {}, pluginRetry.retry)
8586

8687
let patch: string
8788
try {

0 commit comments

Comments
 (0)