1- const core = require ( '@actions/core' ) ;
2- const github = require ( '@actions/github' ) ;
3- const { retry} = require ( '@octokit/plugin-retry' ) ;
4- const { throttling} = require ( '@octokit/plugin-throttling' ) ;
1+ import core from '@actions/core' ;
2+ import github from '@actions/github' ;
3+ import { retry } from '@octokit/plugin-retry' ;
4+ import { throttling } from '@octokit/plugin-throttling' ;
55
66function getClient ( token ) {
7- const rateLimitRetries = 3 ;
7+ const requestRetries = 3 ;
88
99 const rateLimitCallback = function (
1010 retryAfter ,
@@ -16,14 +16,15 @@ function getClient(token) {
1616 `Request quota exhausted for request ${ options . method } ${ options . url } `
1717 ) ;
1818
19- if ( retryCount < rateLimitRetries ) {
19+ if ( retryCount < requestRetries ) {
2020 core . info ( `Retrying after ${ retryAfter } seconds` ) ;
2121
2222 return true ;
2323 }
2424 } ;
2525
2626 const options = {
27+ request : { retries : requestRetries } ,
2728 throttle : {
2829 onSecondaryRateLimit : rateLimitCallback ,
2930 onRateLimit : rateLimitCallback
@@ -33,4 +34,4 @@ function getClient(token) {
3334 return github . getOctokit ( token , options , retry , throttling ) ;
3435}
3536
36- module . exports = { getClient} ;
37+ export { getClient } ;
0 commit comments