Skip to content

Commit ded987c

Browse files
author
Federico Builes
committed
Downgrade usage of retries.
This commit reverts: f736354 76b050a 8dc52cd
1 parent 9f45b24 commit ded987c

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

Diff for: __tests__/dependency-graph.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ test('it properly catches RequestError type', async () => {
2424
headRef: 'refs/heads/master'
2525
})
2626
} catch (error) {
27-
const err = error as RequestError
28-
expect(err.status).toBe(401)
27+
expect(error).toBeInstanceOf(RequestError)
2928
}
3029
})

Diff for: src/comment-pr.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import * as github from '@actions/github'
22
import * as core from '@actions/core'
33
import * as githubUtils from '@actions/github/lib/utils'
4-
import {retry} from '@octokit/plugin-retry'
4+
import * as retry from '@octokit/plugin-retry'
55
import {RequestError} from '@octokit/request-error'
6-
import {Octokit} from '@octokit/rest'
76

8-
const retryingOctokit = Octokit.plugin(retry)
7+
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry)
98
const octo = new retryingOctokit(
109
githubUtils.getOctokitOptions(core.getInput('repo-token', {required: true}))
1110
)

Diff for: src/dependency-graph.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import * as core from '@actions/core'
22
import * as githubUtils from '@actions/github/lib/utils'
3-
import {Octokit} from '@octokit/core'
4-
import {retry} from '@octokit/plugin-retry'
5-
import {paginateRest} from '@octokit/plugin-paginate-rest'
6-
3+
import * as retry from '@octokit/plugin-retry'
74
import {
85
ChangesSchema,
96
ComparisonResponse,
107
ComparisonResponseSchema
118
} from './schemas'
129

13-
const retryingOctokit = Octokit.plugin(retry, paginateRest)
10+
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry)
1411
const SnapshotWarningsHeader = 'x-github-dependency-graph-snapshot-warnings'
1512
const octo = new retryingOctokit(
1613
githubUtils.getOctokitOptions(core.getInput('repo-token', {required: true}))

0 commit comments

Comments
 (0)