@@ -33961,122 +33961,112 @@ var __webpack_exports__ = {};
33961
33961
"use strict";
33962
33962
33963
33963
33964
- const core = __nccwpck_require__(9093)
33965
- const axios = __nccwpck_require__(314)
33966
- const https = __nccwpck_require__(5687)
33967
- const { request, METHOD_POST } = __nccwpck_require__(3537)
33968
- const { GithubActions } = __nccwpck_require__(7851)
33964
+ const core = __nccwpck_require__(9093);
33965
+ const axios = __nccwpck_require__(314);
33966
+ const https = __nccwpck_require__(5687);
33967
+ const { request, METHOD_POST } = __nccwpck_require__(3537);
33968
+ const { GithubActions } = __nccwpck_require__(7851);
33969
33969
33970
- const { createPersistHandler } = __nccwpck_require__(8403)
33971
- const { createOutputHandler } = __nccwpck_require__(8986)
33972
- const { createMaskHandler } = __nccwpck_require__(40)
33970
+ const { createPersistHandler } = __nccwpck_require__(8403);
33971
+ const { createOutputHandler } = __nccwpck_require__(8986);
33972
+ const { createMaskHandler } = __nccwpck_require__(40);
33973
33973
33974
33974
let customHeaders = {}
33975
33975
33976
33976
if (!!core.getInput('customHeaders')) {
33977
- try {
33978
- customHeaders = JSON.parse(core.getInput('customHeaders'))
33979
- } catch (error) {
33980
- core.debug(
33981
- `Invalid customHeaders string: ${core.getInput('customHeaders')}`
33982
- )
33983
- core.error(`Could not parse customHeaders string value: ${error}`)
33984
- }
33977
+ try {
33978
+ customHeaders = JSON.parse(core.getInput('customHeaders'));
33979
+ } catch(error) {
33980
+ core.debug(`Invalid customHeaders string: ${core.getInput('customHeaders')}`)
33981
+ core.error(`Could not parse customHeaders string value: ${error}`)
33982
+ }
33985
33983
}
33986
33984
33987
- const headers = {
33988
- 'Content-Type': core.getInput('contentType') || 'application/json',
33989
- }
33985
+ const headers = { 'Content-Type': core.getInput('contentType') || 'application/json' }
33990
33986
33991
33987
if (!!core.getInput('bearerToken')) {
33992
- headers['Authorization'] = `Bearer ${core.getInput('bearerToken')}`
33988
+ headers['Authorization'] = `Bearer ${core.getInput('bearerToken')}`;
33993
33989
}
33994
33990
33995
33991
/** @type {axios.AxiosRequestConfig} */
33996
33992
const instanceConfig = {
33997
- httpsAgent: new https.Agent({
33998
- rejectUnauthorized: core.getInput('ignoreSsl') !== 'true',
33999
- }),
34000
- baseURL: core.getInput('url', { required: true }),
34001
- timeout: parseInt(core.getInput('timeout') || 5000, 10),
34002
- headers: { ...headers, ...customHeaders },
33993
+ httpsAgent: new https.Agent({
33994
+ rejectUnauthorized: core.getInput('ignoreSsl') !== 'true',
33995
+ }),
33996
+ baseURL: core.getInput('url', { required: true }),
33997
+ timeout: parseInt(core.getInput('timeout') || 5000, 10),
33998
+ headers: { ...headers, ...customHeaders }
34003
33999
}
34004
34000
34005
34001
if (!!core.getInput('httpsCA') || !!core.getInput('httpsCert')) {
34006
- instanceConfig.httpsAgent = new https.Agent({
34007
- ca: core.getInput('httpsCA') || undefined,
34008
- cert: core.getInput('httpsCert') || undefined,
34009
- key: core.getInput('httpsKey') || undefined,
34010
- })
34002
+ instanceConfig.httpsAgent = new https.Agent({
34003
+ ca: core.getInput('httpsCA') || undefined,
34004
+ cert: core.getInput('httpsCert') || undefined,
34005
+ key: core.getInput('httpsKey') || undefined
34006
+ })
34011
34007
}
34012
34008
34013
34009
if (!!core.getInput('username') || !!core.getInput('password')) {
34014
- core.debug('Add BasicHTTP Auth config')
34010
+ core.debug('Add BasicHTTP Auth config')
34015
34011
34016
- instanceConfig.auth = {
34017
- username: core.getInput('username'),
34018
- password: core.getInput('password'),
34019
- }
34012
+ instanceConfig.auth = {
34013
+ username: core.getInput('username'),
34014
+ password: core.getInput('password')
34015
+ }
34020
34016
}
34021
34017
34022
34018
let retry = 0
34023
34019
if (!!core.getInput('retry')) {
34024
- retry = parseInt(core.getInput('retry'))
34020
+ retry = parseInt(core.getInput('retry'))
34025
34021
}
34026
34022
34027
34023
let retryWait = 3000
34028
34024
if (!!core.getInput('retryWait')) {
34029
- retryWait = parseInt(core.getInput('retryWait'))
34025
+ retryWait = parseInt(core.getInput('retryWait'))
34030
34026
}
34031
34027
34032
- const data = core.getInput('data') || '{}'
34033
- const files = core.getInput('files') || '{}'
34028
+ const data = core.getInput('data') || '{}';
34029
+ const files = core.getInput('files') || '{}';
34034
34030
const file = core.getInput('file')
34035
34031
const responseFile = core.getInput('responseFile')
34036
- const method = core.getInput('method') || METHOD_POST
34037
- const preventFailureOnNoResponse =
34038
- core.getInput('preventFailureOnNoResponse') === 'true'
34039
- const escapeData = core.getInput('escapeData') === 'true'
34032
+ const method = core.getInput('method') || METHOD_POST;
34033
+ const preventFailureOnNoResponse = core.getInput('preventFailureOnNoResponse') === 'true';
34034
+ const escapeData = core.getInput('escapeData') === 'true';
34040
34035
34041
- const ignoreStatusCodes = core.getInput('ignoreStatusCodes')
34042
- let ignoredCodes = []
34036
+ const ignoreStatusCodes = core.getInput('ignoreStatusCodes');
34037
+ let ignoredCodes = [];
34043
34038
34044
34039
if (typeof ignoreStatusCodes === 'string' && ignoreStatusCodes.length > 0) {
34045
- ignoredCodes = ignoreStatusCodes
34046
- .split(',')
34047
- .map((statusCode) => parseInt(statusCode.trim()))
34040
+ ignoredCodes = ignoreStatusCodes.split(',').map(statusCode => parseInt(statusCode.trim()))
34048
34041
}
34049
34042
34050
- const actions = new GithubActions()
34043
+ const actions = new GithubActions();
34051
34044
34052
- const handler = []
34045
+ const handler = [];
34053
34046
34054
34047
if (core.getBooleanInput('maskResponse')) {
34055
- handler.push(createMaskHandler(actions))
34048
+ handler.push(createMaskHandler(actions))
34056
34049
}
34057
34050
34058
34051
handler.push(createOutputHandler(actions))
34059
34052
34060
34053
if (!!responseFile) {
34061
- handler.push(createPersistHandler(responseFile, actions))
34054
+ handler.push(createPersistHandler(responseFile, actions))
34062
34055
}
34063
34056
34064
34057
const options = {
34065
- ignoredCodes,
34066
- preventFailureOnNoResponse,
34067
- escapeData,
34068
- retry,
34069
- retryWait,
34058
+ ignoredCodes,
34059
+ preventFailureOnNoResponse,
34060
+ escapeData,
34061
+ retry,
34062
+ retryWait
34070
34063
}
34071
34064
34072
- request({ data, method, instanceConfig, files, file, actions, options }).then(
34073
- (response) => {
34074
- if (response && typeof response == 'object') {
34075
- handler.forEach((h) => h(response))
34076
- }
34077
- }
34078
- )
34079
-
34065
+ request({ data, method, instanceConfig, files, file, actions, options }).then(response => {
34066
+ if (response && typeof response == 'object') {
34067
+ handler.forEach(h => h(response))
34068
+ }
34069
+ })
34080
34070
})();
34081
34071
34082
34072
module.exports = __webpack_exports__;
0 commit comments