Skip to content

Commit

Permalink
Downgrade usage of retries.
Browse files Browse the repository at this point in the history
This commit reverts:

f736354
76b050a
8dc52cd
  • Loading branch information
febuiles committed Nov 8, 2023
1 parent 9f45b24 commit ded987c
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions __tests__/dependency-graph.test.ts
Original file line number Diff line number Diff line change
@@ -24,7 +24,6 @@ test('it properly catches RequestError type', async () => {
headRef: 'refs/heads/master'
})
} catch (error) {
const err = error as RequestError
expect(err.status).toBe(401)
expect(error).toBeInstanceOf(RequestError)
}
})
5 changes: 2 additions & 3 deletions src/comment-pr.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as github from '@actions/github'
import * as core from '@actions/core'
import * as githubUtils from '@actions/github/lib/utils'
import {retry} from '@octokit/plugin-retry'
import * as retry from '@octokit/plugin-retry'
import {RequestError} from '@octokit/request-error'
import {Octokit} from '@octokit/rest'

const retryingOctokit = Octokit.plugin(retry)
const retryingOctokit = githubUtils.GitHub.plugin(retry.retry)
const octo = new retryingOctokit(
githubUtils.getOctokitOptions(core.getInput('repo-token', {required: true}))
)
7 changes: 2 additions & 5 deletions src/dependency-graph.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import * as core from '@actions/core'
import * as githubUtils from '@actions/github/lib/utils'
import {Octokit} from '@octokit/core'
import {retry} from '@octokit/plugin-retry'
import {paginateRest} from '@octokit/plugin-paginate-rest'

import * as retry from '@octokit/plugin-retry'
import {
ChangesSchema,
ComparisonResponse,
ComparisonResponseSchema
} from './schemas'

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

0 comments on commit ded987c

Please sign in to comment.