Add ignore ssl error (#145)

* add ignore ssl
* build and update docs
* keep the upstream formatting/indentation
This commit is contained in:
Kittizz 2024-04-20 19:34:12 +07:00 committed by GitHub
parent 8af2803109
commit ed8a1c36db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 565 additions and 554 deletions

View file

@ -48,6 +48,7 @@ jobs:
|maskResponse| If set to true, the response will be masked in the logs of the action |'false'|
|retry| optional amount of retries if the request is failing, does not retry if the status code is ignored ||
|retryWait| time between each retry in millseconds | 3000 |
|ignoreSsl| ignore ssl verify (rejectUnauthorized: false) | false |
### Response

View file

@ -69,6 +69,9 @@ inputs:
retryWait:
description: 'wait time between retries in milliseconds'
required: false
ignoreSsl:
description: 'ignore ssl verify (rejectUnauthorized: false)'
default: 'false'
outputs:
response:
description: 'HTTP Response Content'

1110
dist/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -29,6 +29,9 @@ if (!!core.getInput('bearerToken')) {
/** @type {axios.AxiosRequestConfig} */
const instanceConfig = {
httpsAgent: new https.Agent({
rejectUnauthorized: core.getInput('ignoreSsl') !== 'true',
}),
baseURL: core.getInput('url', { required: true }),
timeout: parseInt(core.getInput('timeout') || 5000, 10),
headers: { ...headers, ...customHeaders }
@ -102,4 +105,4 @@ request({ data, method, instanceConfig, files, file, actions, options }).then(re
if (response && typeof response == 'object') {
handler.forEach(h => h(response))
}
})
})