@@ -246,7 +246,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
246246 return result;
247247};
248248Object.defineProperty(exports, "__esModule", { value: true });
249- exports.getOctokitOptions = exports.GitHub = exports.context = void 0;
249+ exports.getOctokitOptions = exports.GitHub = exports.defaults = exports. context = void 0;
250250const Context = __importStar(__webpack_require__(53));
251251const Utils = __importStar(__webpack_require__(914));
252252// octokit + plugins
@@ -255,13 +255,13 @@ const plugin_rest_endpoint_methods_1 = __webpack_require__(45);
255255const plugin_paginate_rest_1 = __webpack_require__(193);
256256exports.context = new Context.Context();
257257const baseUrl = Utils.getApiBaseUrl();
258- const defaults = {
258+ exports. defaults = {
259259 baseUrl,
260260 request: {
261261 agent: Utils.getProxyAgent(baseUrl)
262262 }
263263};
264- exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);
264+ exports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(exports. defaults);
265265/**
266266 * Convience function to correctly format Octokit Options to pass into the constructor.
267267 *
@@ -13322,6 +13322,9 @@ var exec = __webpack_require__(514);
1332213322// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js
1332313323var lib_github = __webpack_require__(438);
1332413324
13325+ // EXTERNAL MODULE: ./node_modules/@actions/github/lib/utils.js
13326+ var utils = __webpack_require__(30);
13327+
1332513328// EXTERNAL MODULE: ./node_modules/@actions/glob/lib/glob.js
1332613329var glob = __webpack_require__(90);
1332713330
@@ -13340,18 +13343,22 @@ function callAsyncFunction(args, source) {
1334013343
1334113344// CONCATENATED MODULE: ./src/retry-options.ts
1334213345
13343- function getRetryOptions(retries, exemptStatusCodes) {
13346+ function getRetryOptions(retries, exemptStatusCodes, defaultOptions ) {
1334413347 var _a;
1334513348 if (retries <= 0) {
13346- return [{ enabled: false }, {} ];
13349+ return [{ enabled: false }, defaultOptions.request ];
1334713350 }
1334813351 const retryOptions = {
1334913352 enabled: true
1335013353 };
1335113354 if (exemptStatusCodes.length > 0) {
1335213355 retryOptions.doNotRetry = exemptStatusCodes;
1335313356 }
13357+ // The GitHub type has some defaults for `options.request`
13358+ // see: https://github.com/actions/toolkit/blob/4fbc5c941a57249b19562015edbd72add14be93d/packages/github/src/utils.ts#L15
13359+ // We pass these in here so they are not overidden.
1335413360 const requestOptions = {
13361+ ...defaultOptions.request,
1335513362 retries
1335613363 };
1335713364 Object(core.debug)(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions === null || retryOptions === void 0 ? void 0 : retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : 'octokit default: [400, 401, 403, 404, 422]'})`);
@@ -13401,6 +13408,7 @@ const wrapRequire = new Proxy(require, {
1340113408
1340213409
1340313410
13411+
1340413412process.on('unhandledRejection', handleError);
1340513413main().catch(handleError);
1340613414async function main() {
@@ -13410,7 +13418,7 @@ async function main() {
1341013418 const previews = Object(core.getInput)('previews');
1341113419 const retries = parseInt(Object(core.getInput)('retries'));
1341213420 const exemptStatusCodes = parseNumberArray(Object(core.getInput)('retry-exempt-status-codes'));
13413- const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes);
13421+ const [retryOpts, requestOpts] = getRetryOptions(retries, exemptStatusCodes, utils.defaults );
1341413422 const opts = {};
1341513423 if (debug === 'true')
1341613424 opts.log = console;
0 commit comments