Compare commits

...

24 Commits

Author SHA1 Message Date
Frank Jogeleit
74e0e96181 update build
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2024-04-06 10:17:23 +02:00
Frank Jogeleit
2bb8059d00 Merge pull request #143 from fjogeleit/fixes
fix retry and ignore status response
2024-04-06 10:03:47 +02:00
Frank Jogeleit
bfbe4dd6af fix retry and ignore status response
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2024-04-06 09:53:11 +02:00
Frank Jogeleit
7c708e96af Merge pull request #139 from fjogeleit/dependabot/npm_and_yarn/undici-5.28.4
Bump undici from 5.28.3 to 5.28.4
2024-04-04 20:09:54 +02:00
dependabot[bot]
f9dc1a8d4b Bump undici from 5.28.3 to 5.28.4
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.3...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 17:19:56 +00:00
Frank Jogeleit
33a4d079d7 Merge pull request #138 from fjogeleit/dependabot/npm_and_yarn/axios-1.6.8
Bump axios from 1.6.7 to 1.6.8
2024-03-19 07:51:06 +01:00
dependabot[bot]
0b6ec5eadd Bump axios from 1.6.7 to 1.6.8
Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.6.8.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.6.7...v1.6.8)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 17:37:38 +00:00
Frank Jogeleit
897b6a3c96 Merge pull request #137 from fjogeleit/dependabot/npm_and_yarn/follow-redirects-1.15.6
Bump follow-redirects from 1.15.4 to 1.15.6
2024-03-17 07:07:59 +01:00
dependabot[bot]
363da44e0a Bump follow-redirects from 1.15.4 to 1.15.6
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-16 22:35:08 +00:00
Frank Jogeleit
1a131d17cc Merge pull request #136 from ClayenKitten/patch-1
docs: wrong `timeout` input description
2024-03-16 16:38:44 +01:00
ClayenKitten
72a0a5b93e docs: wrong timeout input description 2024-03-16 18:35:51 +03:00
Frank Jogeleit
606bb16fb9 Merge pull request #135 from fjogeleit/dependabot/npm_and_yarn/undici-5.28.3
Bump undici from 5.28.2 to 5.28.3
2024-02-16 21:30:45 +01:00
dependabot[bot]
517601f732 Bump undici from 5.28.2 to 5.28.3
Bumps [undici](https://github.com/nodejs/undici) from 5.28.2 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.2...v5.28.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-16 18:40:16 +00:00
Frank Jogeleit
c9a231b621 Merge pull request #134 from fjogeleit/dependabot/npm_and_yarn/axios-1.6.7
Bump axios from 1.6.5 to 1.6.7
2024-01-29 18:48:27 +01:00
dependabot[bot]
2e6550f5bd Bump axios from 1.6.5 to 1.6.7
Bumps [axios](https://github.com/axios/axios) from 1.6.5 to 1.6.7.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.6.5...v1.6.7)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 17:04:46 +00:00
Frank Jogeleit
caab55e3d8 Merge pull request #132 from rgb2hsl/patch-1
Typo fix in README.md
2024-01-12 08:17:04 +01:00
Eugene
997aeb8de8 typo fix in README.md 2024-01-12 02:27:14 +04:00
Frank Jogeleit
0bd00a33db Merge pull request #131 from fjogeleit/node-upgrade
Upgrade to Node20
2024-01-08 14:43:30 +01:00
Frank Jogeleit
a665541d9c Upgrade to Node20
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2024-01-08 14:40:25 +01:00
Frank Jogeleit
e23645bd9b Merge pull request #128 from fjogeleit/dependabot/npm_and_yarn/axios-1.6.3
Bump axios from 1.6.2 to 1.6.3
2024-01-01 19:08:53 +01:00
dependabot[bot]
897543ff26 Bump axios from 1.6.2 to 1.6.3
Bumps [axios](https://github.com/axios/axios) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.6.2...v1.6.3)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 17:03:36 +00:00
Frank Jogeleit
3fee944184 Merge pull request #127 from fjogeleit/revert-conditional-stringify
revert conditional stringify which leads to breaking changes with older versions
2023-12-19 09:14:06 +01:00
Frank Jogeleit
c23f0d6631 revert conitional stringify which leads to breaking changes with older versions
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-12-19 09:12:54 +01:00
Frank Jogeleit
6dd87961de update readme
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-12-18 10:11:52 +01:00
8 changed files with 1118 additions and 391 deletions

View File

@@ -45,6 +45,7 @@ jobs:
|httpsCert| Client Certificate as string || |httpsCert| Client Certificate as string ||
|httpsKey| Client Certificate Key as string || |httpsKey| Client Certificate Key as string ||
|responseFile| Persist the response data to the specified file path || |responseFile| Persist the response data to the specified file path ||
|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 |
@@ -99,4 +100,4 @@ Optionen:
--bearerToken bearer token without Bearer prefix, added as --bearerToken bearer token without Bearer prefix, added as
Authorization header [string] Authorization header [string]
--timeout request timeout [number] [default: 5000] --timeout request timeout [number] [default: 5000]
``` ```

View File

@@ -29,7 +29,7 @@ inputs:
description: 'Auth Password' description: 'Auth Password'
required: false required: false
timeout: timeout:
description: 'Request Timeout in Sec' description: 'Request Timeout in milliseconds'
required: false required: false
default: '5000' default: '5000'
bearerToken: bearerToken:
@@ -75,5 +75,5 @@ outputs:
headers: headers:
description: 'HTTP Response Headers' description: 'HTTP Response Headers'
runs: runs:
using: 'node16' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'

1460
dist/index.js vendored

File diff suppressed because it is too large Load Diff

24
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "http-request-action", "name": "http-request-action",
"version": "1.14.1", "version": "1.14.2",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "http-request-action", "name": "http-request-action",
"version": "1.14.1", "version": "1.14.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1" "@actions/core": "^1.10.1"
@@ -87,12 +87,12 @@
"dev": true "dev": true
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.6.2", "version": "1.6.8",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.15.6",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"proxy-from-env": "^1.1.0" "proxy-from-env": "^1.1.0"
} }
@@ -166,9 +166,9 @@
} }
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.15.3", "version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -288,9 +288,9 @@
} }
}, },
"node_modules/undici": { "node_modules/undici": {
"version": "5.27.2", "version": "5.28.4",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
"integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
"dependencies": { "dependencies": {
"@fastify/busboy": "^2.0.0" "@fastify/busboy": "^2.0.0"
}, },

View File

@@ -9,13 +9,7 @@ const { GithubActions } = require('../githubActions');
* @returns {(response: axios.AxiosResponse) => void} * @returns {(response: axios.AxiosResponse) => void}
*/ */
const createMaskHandler = (actions) => (response) => { const createMaskHandler = (actions) => (response) => {
let data = response.data actions.setSecret(JSON.stringify(response.data))
if (typeof data == 'object') {
data = JSON.stringify(data)
}
actions.setSecret(data)
} }
module.exports = { createMaskHandler } module.exports = { createMaskHandler }

View File

@@ -9,7 +9,7 @@ const { GithubActions } = require('../githubActions');
* @returns {(response: axios.AxiosResponse) => void} * @returns {(response: axios.AxiosResponse) => void}
*/ */
const createOutputHandler = (actions) => (response) => { const createOutputHandler = (actions) => (response) => {
actions.setOutput('response', response.data) actions.setOutput('response', JSON.stringify(response.data))
actions.setOutput('headers', response.headers) actions.setOutput('headers', response.headers)
} }

View File

@@ -55,7 +55,7 @@ const retry = async (callback, options) => {
lastErr = err; lastErr = err;
} }
if (i < options.retries) { if (i < options.retry) {
options.actions.warning(`#${i + 1} request failed: ${err}`); options.actions.warning(`#${i + 1} request failed: ${err}`);
await sleep(options.sleep); await sleep(options.sleep);
} }

View File

@@ -94,10 +94,10 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti
} catch(error) { } catch(error) {
if (error.response && options.ignoredCodes.includes(error.response.status)) { if (error.response && options.ignoredCodes.includes(error.response.status)) {
actions.warning(`ignored status code: ${JSON.stringify({ code: error.response.status, message: error.response.data })}`) actions.warning(`ignored status code: ${JSON.stringify({ code: error.response.status, message: error.response.data })}`)
return null return error.response
} }
if (!error.response && error.request && options.preventFailureOnNoResponse) { if (!error.response && error.request && options.preventFailureOnNoResponse) {
actions.warning(`no response received: ${JSON.stringify(error)}`); actions.warning(`no response received: ${JSON.stringify(error)}`);