Skip to content

Commit

Permalink
Add retry mechanism to octokit client
Browse files Browse the repository at this point in the history
  • Loading branch information
imranismail committed Jan 19, 2021
1 parent 91ce0fb commit 60866b9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@actions/core": "^1.2.6",
"@actions/io": "^1.0.2",
"@actions/tool-cache": "^1.3.3",
"@octokit/plugin-retry": "^3.0.6",
"@octokit/rest": "^18.0.6",
"semver": "^7.3.2"
},
Expand Down
4 changes: 3 additions & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Load tempDirectory before it gets wiped by tool-cache
import {Octokit} from '@octokit/rest'
import {retry} from '@octokit/plugin-retry'
import * as core from '@actions/core'
import * as cache from '@actions/tool-cache'
import * as path from 'path'
import * as semver from 'semver'
import * as fs from 'fs'
let tempDirectory = process.env['RUNNER_TEMPDIRECTORY'] || ''

const octokit = new Octokit()
const RetriableOctokit = Octokit.plugin(retry)
const octokit = new RetriableOctokit()
const versionRegex = /\d+\.?\d*\.?\d*/
const toolName = 'kustomize'
const platform = process.platform
Expand Down

0 comments on commit 60866b9

Please sign in to comment.