Skip to content

Commit 095d3fc

Browse files
committed
Add automatic Retry capability to Add-to-project action
- Imported octokit-retry package to action
1 parent 5b1a254 commit 095d3fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/add-to-project.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as core from '@actions/core'
22
import * as github from '@actions/github'
3+
import { retry } from "@octokit/plugin-retry";
34

45
const urlParse = /\/(?<ownerType>orgs|users)\/(?<ownerName>[^/]+)\/projects\/(?<projectNumber>\d+)/
56

@@ -44,7 +45,7 @@ export async function addToProject(): Promise<void> {
4445
.filter(l => l.length > 0) ?? []
4546
const labelOperator = core.getInput('label-operator').trim().toLocaleLowerCase()
4647

47-
const octokit = github.getOctokit(ghToken)
48+
const octokit = github.getOctokit(ghToken, {}, [retry])
4849

4950
const issue = github.context.payload.issue ?? github.context.payload.pull_request
5051
const issueLabels: string[] = (issue?.labels ?? []).map((l: {name: string}) => l.name.toLowerCase())

0 commit comments

Comments
 (0)