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'| |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 || |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 | |retryWait| time between each retry in millseconds | 3000 |
|ignoreSsl| ignore ssl verify (rejectUnauthorized: false) | false |
### Response ### Response

View file

@ -69,6 +69,9 @@ inputs:
retryWait: retryWait:
description: 'wait time between retries in milliseconds' description: 'wait time between retries in milliseconds'
required: false required: false
ignoreSsl:
description: 'ignore ssl verify (rejectUnauthorized: false)'
default: 'false'
outputs: outputs:
response: response:
description: 'HTTP Response Content' 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} */ /** @type {axios.AxiosRequestConfig} */
const instanceConfig = { const instanceConfig = {
httpsAgent: new https.Agent({
rejectUnauthorized: core.getInput('ignoreSsl') !== 'true',
}),
baseURL: core.getInput('url', { required: true }), baseURL: core.getInput('url', { required: true }),
timeout: parseInt(core.getInput('timeout') || 5000, 10), timeout: parseInt(core.getInput('timeout') || 5000, 10),
headers: { ...headers, ...customHeaders } headers: { ...headers, ...customHeaders }
@ -102,4 +105,4 @@ request({ data, method, instanceConfig, files, file, actions, options }).then(re
if (response && typeof response == 'object') { if (response && typeof response == 'object') {
handler.forEach(h => h(response)) handler.forEach(h => h(response))
} }
}) })