1
0
Fork 0
mirror of https://github.com/fjogeleit/http-request-action.git synced 2025-04-23 23:24:32 +00:00

Compare commits

...

197 commits
v1.4.1 ... main

Author SHA1 Message Date
Frank Jogeleit
50734d6ff5
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.8.4d
Bump axios from 1.8.3 to 1.8.4
2025-03-24 18:53:53 +01:00
dependabot[bot]
e5f229f068
Bump axios from 1.8.3 to 1.8.4
Bumps [axios](https://github.com/axios/axios) from 1.8.3 to 1.8.4.
- [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.8.3...v1.8.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 17:45:20 +00:00
Frank Jogeleit
1709f318cd
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.8.3
Bump axios from 1.8.2 to 1.8.3
2025-03-17 19:20:12 +01:00
dependabot[bot]
5c400e2bc4
Bump axios from 1.8.2 to 1.8.3
Bumps [axios](https://github.com/axios/axios) from 1.8.2 to 1.8.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.8.2...v1.8.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 18:02:33 +00:00
Frank Jogeleit
b12240f543
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.8.2
Bump axios from 1.8.1 to 1.8.2
2025-03-10 23:29:10 +01:00
dependabot[bot]
90fd7d3206
Bump axios from 1.8.1 to 1.8.2
Bumps [axios](https://github.com/axios/axios) from 1.8.1 to 1.8.2.
- [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.8.1...v1.8.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-10 18:30:25 +00:00
Frank Jogeleit
18930d9c3a
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.8.1
Bump axios from 1.7.9 to 1.8.1
2025-03-03 23:11:34 +01:00
dependabot[bot]
73373685ae
Bump axios from 1.7.9 to 1.8.1
Bumps [axios](https://github.com/axios/axios) from 1.7.9 to 1.8.1.
- [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.7.9...v1.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 17:22:49 +00:00
Frank Jogeleit
5419a58b02
Merge pull request from fjogeleit/dependabot/npm_and_yarn/undici-5.28.5
Bump undici from 5.28.4 to 5.28.5
2025-02-17 19:51:29 +01:00
dependabot[bot]
75020ad6eb
Bump undici from 5.28.4 to 5.28.5
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.28.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 18:00:33 +00:00
Frank Jogeleit
465f4de861
Merge pull request from fjogeleit/dependabot/npm_and_yarn/form-data-4.0.2
Bump form-data from 4.0.1 to 4.0.2
2025-02-17 18:59:32 +01:00
dependabot[bot]
cfb5583910
Bump form-data from 4.0.1 to 4.0.2
Bumps [form-data](https://github.com/form-data/form-data) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/form-data/form-data/releases)
- [Commits](https://github.com/form-data/form-data/compare/v4.0.1...v4.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 17:33:51 +00:00
Frank Jogeleit
23ad54bcd1
Merge pull request from fjogeleit/dependency-updates
dependency updates
2024-12-06 16:51:08 +01:00
Frank Jogeleit
1f693e5f61 dependency updates
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
2024-12-06 16:50:02 +01:00
Frank Jogeleit
4ea8974961
Merge pull request from fjogeleit/dependabot/npm_and_yarn/vercel/ncc-0.38.3
Bump @vercel/ncc from 0.38.2 to 0.38.3
2024-12-06 16:44:43 +01:00
Frank Jogeleit
4d0fdb4907
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.7.8
Bump axios from 1.7.7 to 1.7.8
2024-12-03 01:13:35 +01:00
dependabot[bot]
93461a85b6
Bump axios from 1.7.7 to 1.7.8
Bumps [axios](https://github.com/axios/axios) from 1.7.7 to 1.7.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.7.7...v1.7.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-12-02 18:31:31 +00:00
dependabot[bot]
6b27404bb5
Bump @vercel/ncc from 0.38.2 to 0.38.3
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.2 to 0.38.3.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.2...0.38.3)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 17:55:06 +00:00
Frank Jogeleit
bc28d96e05
Merge pull request from fjogeleit/dependabot/npm_and_yarn/form-data-4.0.1
Bump form-data from 4.0.0 to 4.0.1
2024-10-14 19:17:12 +02:00
dependabot[bot]
2f69e39476
Bump form-data from 4.0.0 to 4.0.1
Bumps [form-data](https://github.com/form-data/form-data) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/form-data/form-data/releases)
- [Commits](https://github.com/form-data/form-data/compare/v4.0.0...v4.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-14 17:16:21 +00:00
Frank Jogeleit
9fa4000143
Merge pull request from fjogeleit/dependabot/npm_and_yarn/actions/core-1.11.1
Bump @actions/core from 1.10.1 to 1.11.1
2024-10-07 19:51:44 +02:00
dependabot[bot]
9803f436f3
Bump @actions/core from 1.10.1 to 1.11.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.1 to 1.11.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 17:05:31 +00:00
Frank Jogeleit
bf78da1411 stop execution after read content-length error
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
2024-10-06 15:52:01 +02:00
Frank Jogeleit
c54053fb4a fix config update error output
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
2024-10-06 15:41:40 +02:00
Frank Jogeleit
46e3792733 add actual error message
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
2024-10-06 13:41:07 +02:00
Frank Jogeleit
4a50afee6f add actual error message
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
2024-10-06 13:39:59 +02:00
Frank Jogeleit
04043b9aef update package.json version
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
2024-09-10 15:21:29 +02:00
Frank Jogeleit
07eceb44a4
depedency updates ()
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
2024-09-10 15:16:38 +02:00
dependabot[bot]
5cfc483290
Bump axios from 1.7.5 to 1.7.7 ()
Bumps [axios](https://github.com/axios/axios) from 1.7.5 to 1.7.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.7.5...v1.7.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-03 06:33:38 +02:00
dependabot[bot]
53f5db2650
Bump axios from 1.7.4 to 1.7.5 ()
Bumps [axios](https://github.com/axios/axios) from 1.7.4 to 1.7.5.
- [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.7.4...v1.7.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 19:05:48 +02:00
dependabot[bot]
97bb93c5b1
Bump axios from 1.7.3 to 1.7.4 ()
Bumps [axios](https://github.com/axios/axios) from 1.7.3 to 1.7.4.
- [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.7.3...v1.7.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 23:14:30 +02:00
dependabot[bot]
64c456606f
Bump axios from 1.7.2 to 1.7.3 ()
Bumps [axios](https://github.com/axios/axios) from 1.7.2 to 1.7.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.7.2...v1.7.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 19:38:56 +02:00
Sebastien Vermeille
62761453c7
Add an IT test to verify DELETE method works as expected () 2024-08-05 13:12:21 +02:00
Sebastien Vermeille
aeef78bb14
Add tests with assertions ()
That way not only inputs are tested but also outputs
2024-07-29 20:16:03 +02:00
Frank Jogeleit
44816be1ea fix err not defined
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2024-06-04 21:21:22 +02:00
Frank Jogeleit
dea4657059 dep update
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2024-05-31 10:57:30 +02:00
Kurt Bonheure
ae65a272d9
Update action.yml ()
Added status as output in action.yml
2024-05-30 16:11:49 +02:00
dependabot[bot]
6cbe966de9
Bump axios from 1.7.1 to 1.7.2 ()
Bumps [axios](https://github.com/axios/axios) from 1.7.1 to 1.7.2.
- [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.7.1...v1.7.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 20:08:58 +02:00
dependabot[bot]
1e440b8b8c
Bump axios from 1.6.8 to 1.7.1 ()
Bumps [axios](https://github.com/axios/axios) from 1.6.8 to 1.7.1.
- [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.8...v1.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 23:09:55 +02:00
Jeremy Turowetz
7d4a18ad25
Add status to outputs ()
* Add status to outputs

* add response.status info to readme

* build new version
2024-05-04 06:59:04 +02:00
Kittizz
ed8a1c36db
Add ignore ssl error ()
* add ignore ssl
* build and update docs
* keep the upstream formatting/indentation
2024-04-20 14:34:12 +02:00
Frank Jogeleit
8af2803109
Merge pull request from fjogeleit/fix-retryWait
fix retryWait mapping
2024-04-06 13:26:11 +02:00
Frank Jogeleit
8537e58734 fix retryWait mapping
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2024-04-06 13:22:18 +02:00
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 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 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 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 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 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 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 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 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 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 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 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
Frank Jogeleit
d81c81a128
Merge pull request from fjogeleit/response-mask
mask response as secret if configured
2023-12-18 10:09:48 +01:00
Frank Jogeleit
2d6a2f17dc mask response as secret if configured
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-12-17 15:41:37 +01:00
Frank Jogeleit
25a5a55111
Merge pull request from fjogeleit/dep-update
dependency updates
2023-11-20 21:42:34 +01:00
Frank Jogeleit
e1affb38cd dependency updates
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-11-20 21:40:45 +01:00
Frank Jogeleit
3abafba399
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.6.2
Bump axios from 1.6.0 to 1.6.2
2023-11-20 18:59:09 +01:00
dependabot[bot]
17b52dc74f
Bump axios from 1.6.0 to 1.6.2
Bumps [axios](https://github.com/axios/axios) from 1.6.0 to 1.6.2.
- [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.0...v1.6.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 17:56:02 +00:00
Frank Jogeleit
04de458128
Merge pull request from fjogeleit/dependabot/github_actions/actions/setup-node-4
Bump actions/setup-node from 3 to 4
2023-11-02 01:05:16 +01:00
dependabot[bot]
6769207b0b
Bump actions/setup-node from 3 to 4
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-01 17:51:26 +00:00
Frank Jogeleit
37cfb73c02
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.6.0
Bump axios from 1.5.1 to 1.6.0
2023-10-30 23:27:22 +01:00
dependabot[bot]
7273a89218
Bump axios from 1.5.1 to 1.6.0
Bumps [axios](https://github.com/axios/axios) from 1.5.1 to 1.6.0.
- [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.5.1...v1.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 17:14:42 +00:00
Frank Jogeleit
d08c0d1c88
Merge pull request from fjogeleit/dependabot/npm_and_yarn/vercel/ncc-0.38.1
Bump @vercel/ncc from 0.38.0 to 0.38.1
2023-10-23 23:45:25 +02:00
dependabot[bot]
9580c192fd
Bump @vercel/ncc from 0.38.0 to 0.38.1
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.0 to 0.38.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.0...0.38.1)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-23 17:52:07 +00:00
Frank Jogeleit
41c615e3c0
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.5.1
Bump axios from 1.5.0 to 1.5.1
2023-10-02 21:19:27 +02:00
dependabot[bot]
845e3400a7
Bump axios from 1.5.0 to 1.5.1
Bumps [axios](https://github.com/axios/axios) from 1.5.0 to 1.5.1.
- [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.5.0...v1.5.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 17:41:00 +00:00
Frank Jogeleit
6871522388
Merge pull request from fjogeleit/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-10-01 20:49:06 +02:00
dependabot[bot]
17c1694300
Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 17:35:20 +00:00
Frank Jogeleit
baf3fe8b8b
Merge pull request from fjogeleit/dependabot/npm_and_yarn/actions/core-1.10.1
Bump @actions/core from 1.10.0 to 1.10.1
2023-09-11 20:43:19 +02:00
Frank Jogeleit
3d8af5c847
Merge pull request from fjogeleit/dependabot/npm_and_yarn/vercel/ncc-0.38.0
Bump @vercel/ncc from 0.36.1 to 0.38.0
2023-09-11 20:42:51 +02:00
dependabot[bot]
35986be8f9
Bump @vercel/ncc from 0.36.1 to 0.38.0
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.36.1 to 0.38.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.36.1...0.38.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 17:07:30 +00:00
dependabot[bot]
3c98f6caf2
Bump @actions/core from 1.10.0 to 1.10.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.0 to 1.10.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 17:07:23 +00:00
Frank Jogeleit
389f30ee3a
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.5.0
Bump axios from 1.4.0 to 1.5.0
2023-08-28 21:05:35 +02:00
dependabot[bot]
e9345a1e67
Bump axios from 1.4.0 to 1.5.0
Bumps [axios](https://github.com/axios/axios) from 1.4.0 to 1.5.0.
- [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.4.0...v1.5.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-28 17:50:48 +00:00
Frank Jogeleit
894ad39332
Merge pull request from fjogeleit/mtls-cert-support
Add mTLS ClientCert support
2023-08-10 11:03:54 +02:00
Frank Jogeleit
25fb88fa43 Add mTLS ClientCert support
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-08-10 10:55:12 +02:00
Frank Jogeleit
eab8015483
Merge pull request from fjogeleit/dependency-update
dependency update
2023-06-26 12:41:33 +02:00
Frank Jogeleit
f62db86b8d dependency update
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-06-26 12:40:30 +02:00
Frank Jogeleit
ef8ec33f46
Merge pull request from fjogeleit/dependabot/npm_and_yarn/yargs-17.7.2
Bump yargs from 17.7.1 to 17.7.2
2023-05-01 21:57:46 +02:00
Frank Jogeleit
c431724973
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.4.0
Bump axios from 1.3.6 to 1.4.0
2023-05-01 21:57:38 +02:00
dependabot[bot]
a9fc010566
Bump axios from 1.3.6 to 1.4.0
Bumps [axios](https://github.com/axios/axios) from 1.3.6 to 1.4.0.
- [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.3.6...v1.4.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 17:56:47 +00:00
dependabot[bot]
8cbbec6c93
Bump yargs from 17.7.1 to 17.7.2
Bumps [yargs](https://github.com/yargs/yargs) from 17.7.1 to 17.7.2.
- [Release notes](https://github.com/yargs/yargs/releases)
- [Changelog](https://github.com/yargs/yargs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/yargs/yargs/compare/v17.7.1...v17.7.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 17:56:41 +00:00
Frank Jogeleit
20c7f757a1
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.3.6
Bump axios from 1.3.5 to 1.3.6
2023-04-24 21:07:08 +02:00
dependabot[bot]
5e4203c2ac
Bump axios from 1.3.5 to 1.3.6
Bumps [axios](https://github.com/axios/axios) from 1.3.5 to 1.3.6.
- [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.3.5...v1.3.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-24 17:56:35 +00:00
Frank Jogeleit
6659346e66
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.3.5
Bump axios from 1.3.4 to 1.3.5
2023-04-10 20:01:33 +02:00
dependabot[bot]
fc0207c5aa
Bump axios from 1.3.4 to 1.3.5
Bumps [axios](https://github.com/axios/axios) from 1.3.4 to 1.3.5.
- [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.3.4...v1.3.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-10 17:56:33 +00:00
Frank Jogeleit
394beeafea log customHeaders parse error
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-03-29 10:53:51 +02:00
Frank Jogeleit
e8dd067b83 adjust cli
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-03-07 11:00:52 +01:00
Frank Jogeleit
a7bd4f21e5
Merge pull request from fjogeleit/develop
retry requests
2023-03-07 10:57:42 +01:00
Frank Jogeleit
2e2dec74b5 retry requests
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-03-06 16:07:02 +01:00
Frank Jogeleit
5f7d5f7c54
Merge pull request from fjogeleit/dependabot/npm_and_yarn/yargs-17.7.1
Bump yargs from 17.7.0 to 17.7.1
2023-02-27 19:19:28 +01:00
Frank Jogeleit
991c07d6d9
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.3.4
Bump axios from 1.3.3 to 1.3.4
2023-02-27 19:19:13 +01:00
dependabot[bot]
5500a62817
Bump yargs from 17.7.0 to 17.7.1
Bumps [yargs](https://github.com/yargs/yargs) from 17.7.0 to 17.7.1.
- [Release notes](https://github.com/yargs/yargs/releases)
- [Changelog](https://github.com/yargs/yargs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/yargs/yargs/compare/v17.7.0...v17.7.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 17:56:43 +00:00
dependabot[bot]
81ecdf1750
Bump axios from 1.3.3 to 1.3.4
Bumps [axios](https://github.com/axios/axios) from 1.3.3 to 1.3.4.
- [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.3.3...v1.3.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 17:56:32 +00:00
Frank Jogeleit
04b426e25f
Merge pull request from fjogeleit/dependabot/npm_and_yarn/yargs-17.7.0
Bump yargs from 17.6.2 to 17.7.0
2023-02-20 19:12:20 +01:00
Frank Jogeleit
fc435761fc
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.3.3
Bump axios from 1.3.2 to 1.3.3
2023-02-20 19:12:09 +01:00
dependabot[bot]
12f71e545a
Bump yargs from 17.6.2 to 17.7.0
Bumps [yargs](https://github.com/yargs/yargs) from 17.6.2 to 17.7.0.
- [Release notes](https://github.com/yargs/yargs/releases)
- [Changelog](https://github.com/yargs/yargs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/yargs/yargs/compare/v17.6.2...v17.7.0)

---
updated-dependencies:
- dependency-name: yargs
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 17:56:42 +00:00
dependabot[bot]
edf33a9d70
Bump axios from 1.3.2 to 1.3.3
Bumps [axios](https://github.com/axios/axios) from 1.3.2 to 1.3.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.3.2...v1.3.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 17:56:36 +00:00
Frank Jogeleit
4ae1dfba85
Merge pull request from fjogeleit/response-file
add persist handler
2023-02-04 13:30:30 +01:00
Frank Jogeleit
2c712a0557 add persist handler
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2023-02-04 13:28:08 +01:00
Frank Jogeleit
0f4905efb7
Merge pull request from fjogeleit/dependabot/npm_and_yarn/vercel/ncc-0.36.1
Bump @vercel/ncc from 0.36.0 to 0.36.1
2023-01-30 18:30:18 +01:00
dependabot[bot]
dfc2f7ac6f
Bump @vercel/ncc from 0.36.0 to 0.36.1
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.36.0 to 0.36.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.36.0...0.36.1)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 17:05:29 +00:00
Frank Jogeleit
52919e91b0
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.2.6
Bump axios from 1.2.3 to 1.2.6
2023-01-30 18:03:58 +01:00
dependabot[bot]
21b59cc25d
Bump axios from 1.2.3 to 1.2.6
Bumps [axios](https://github.com/axios/axios) from 1.2.3 to 1.2.6.
- [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.2.3...v1.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 17:00:41 +00:00
Frank Jogeleit
39d8207c44
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.2.3
Bump axios from 1.2.2 to 1.2.3
2023-01-23 18:01:44 +01:00
dependabot[bot]
74e83dd964
Bump axios from 1.2.2 to 1.2.3
Bumps [axios](https://github.com/axios/axios) from 1.2.2 to 1.2.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/1.2.2...v1.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 17:00:52 +00:00
Frank Jogeleit
00ffa5ecd5
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.2.2
Bump axios from 1.2.1 to 1.2.2
2023-01-02 18:23:58 +01:00
dependabot[bot]
d724e04050
Bump axios from 1.2.1 to 1.2.2
Bumps [axios](https://github.com/axios/axios) from 1.2.1 to 1.2.2.
- [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.2.1...1.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-02 17:00:56 +00:00
Frank Jogeleit
cb13434243
Merge pull request from fjogeleit/dependabot/npm_and_yarn/vercel/ncc-0.36.0
Bump @vercel/ncc from 0.34.0 to 0.36.0
2022-12-26 15:05:23 +01:00
dependabot[bot]
e7440a202a
Bump @vercel/ncc from 0.34.0 to 0.36.0
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.34.0 to 0.36.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.34.0...0.36.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-26 14:05:17 +00:00
Frank Jogeleit
d06672e4c2
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.2.1
Bump axios from 1.2.0 to 1.2.1
2022-12-26 15:04:18 +01:00
dependabot[bot]
322dbb7bdb
Bump axios from 1.2.0 to 1.2.1
Bumps [axios](https://github.com/axios/axios) from 1.2.0 to 1.2.1.
- [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.2.0...v1.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-12 17:00:51 +00:00
Frank Jogeleit
3da643f26a
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.2.0
Bump axios from 1.1.3 to 1.2.0
2022-11-28 19:28:28 +01:00
dependabot[bot]
a9b5bad232
Bump axios from 1.1.3 to 1.2.0
Bumps [axios](https://github.com/axios/axios) from 1.1.3 to 1.2.0.
- [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.1.3...v1.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-28 17:00:46 +00:00
Frank Jogeleit
9e40d70ab2
Merge pull request from fjogeleit/local-cli
Add CLI file for local testing
2022-11-14 11:26:59 +01:00
Frank Jogeleit
e55086ca3f Add CLI file for local testing
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-11-10 12:15:07 +01:00
Frank Jogeleit
86014825e9 Merge branch 'main' of github.com:fjogeleit/http-request-action 2022-11-07 11:45:05 +01:00
Frank Jogeleit
575a0b6560 Update README.md
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-11-07 11:44:46 +01:00
Frank Jogeleit
56da042223
Merge pull request from fjogeleit/url-encoded-tests
Test cases for URLEncoded contentType
2022-11-07 11:11:18 +01:00
Frank Jogeleit
cc3aff9cbe Testcases for URLEncoded contentType 2022-11-07 11:08:34 +01:00
Frank Jogeleit
c4ec44ca3e
Merge pull request from Uzlopak/strict
use strict
2022-11-04 10:35:28 +01:00
uzlopak
b497d195dc use strict 2022-11-04 10:28:14 +01:00
Uzlopak
d00a8759d6
jsdoc: async functions should return Promise ()
* jsdoc: async functions should return Promise

* update dist/index.js

* improve ci

* run anyway

* update dist

* test if esbuild produces deterministic builds

* Update ci.yml

* Update ci.yml

* specify target to node16

* another try

* Check for empty dataJson

Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>

* build dist

Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>

* build latest

* modify test step

* avoid skipping

* go back to ncc

* add back github.ref

* remove  additional stuff

* build dist/index.js

Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
Co-authored-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-11-03 21:35:53 +01:00
Frank Jogeleit
05a08b70e2 build dist
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-11-03 20:46:35 +01:00
Frank Jogeleit
6c12bc1f79 Check for empty dataJson
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-11-03 20:24:38 +01:00
Frank Jogeleit
6796716641
Merge pull request from Uzlopak/improve-ci
Improve ci
2022-11-03 14:41:00 +01:00
Frank Jogeleit
dac2a9ae42
Merge pull request from Uzlopak/add-build-action
add build-action
2022-11-03 14:35:36 +01:00
Frank Jogeleit
79a8b8af48
Merge pull request from fjogeleit/url-encoded
Use URLSearchParams for application/x-www-form-urlencoded
2022-11-03 14:33:24 +01:00
Uzlopak
5bbd839c3e
Update ci.yml 2022-11-03 14:29:31 +01:00
Uzlopak
cf482a5e80
Update and rename test.yml to ci.yml 2022-11-03 14:19:36 +01:00
Frank Jogeleit
76415c3c59
Merge pull request from fjogeleit/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-11-03 14:17:11 +01:00
Frank Jogeleit
3a818e40e8
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-1.1.3
Bump axios from 0.21.4 to 1.1.3
2022-11-03 14:16:57 +01:00
dependabot[bot]
daa3a7f756
Bump axios from 0.21.4 to 1.1.3
Bumps [axios](https://github.com/axios/axios) from 0.21.4 to 1.1.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/v0.21.4...v1.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-03 13:13:42 +00:00
dependabot[bot]
7f60d0a379
Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-03 13:13:39 +00:00
Frank Jogeleit
9adf34b765
Merge pull request from Uzlopak/add-dependabot
add dependabot.yml
2022-11-03 14:13:18 +01:00
Frank Jogeleit
0d5a8b7b31
Merge pull request from Uzlopak/reorder-deps
reorder deps
2022-11-03 14:13:05 +01:00
uzlopak
a8547fbde9 add build-action 2022-11-03 12:06:20 +01:00
uzlopak
a8bcd97403 reorder deps 2022-11-03 12:01:52 +01:00
uzlopak
ce3525d612 add dependabot.yml 2022-11-03 11:56:13 +01:00
Frank Jogeleit
50750c1420 Use URLSearchParams for application/x-www-form-urlencoded 2022-11-01 10:01:33 +01:00
Frank Jogeleit
fd5cf60c69
Merge pull request from fjogeleit/formdata-fix
Fix undefined data for files
2022-10-05 17:31:01 +02:00
Frank Jogeleit
2214f2de10 Fix undefined data for files
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-10-05 17:29:30 +02:00
Frank Jogeleit
9e07856983
Merge pull request from fjogeleit/dependabot/npm_and_yarn/actions/core-1.9.1
Bump @actions/core from 1.9.0 to 1.9.1
2022-08-18 22:06:09 +02:00
dependabot[bot]
df4c18fdd5
Bump @actions/core from 1.9.0 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-18 19:59:33 +00:00
Nick Hills
4cbc7a46b2
Adding ability to return headers without setting debug mode ()
* Update httpClient.js
* Update README.md
* Update action.yml

Co-authored-by: Nick Hills <nick.hills@valtech.com>
2022-08-17 09:56:02 +02:00
Frank Jogeleit
cce3f3d779 Add new httpsCA input to README.md
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-07-23 15:18:23 +02:00
Frank Jogeleit
52ba495021
Merge pull request from fjogeleit/custom-ca-support
Add input for custom CA
2022-07-19 10:29:59 +02:00
Frank Jogeleit
df00cdf429 Add input for custom CA
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-07-19 10:27:31 +02:00
Frank Jogeleit
e3313c1a5f Update Error Output
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-06-04 10:52:53 +02:00
Frank Jogeleit
d4c0bee13c
Merge pull request from yesjinu/docs/enhance-readme
docs: enhance README.md
2022-05-24 13:25:37 +02:00
Jinu Noh
435fe1dbc8
docs: enhance README.md 2022-05-24 19:22:08 +09:00
Frank Jogeleit
35336be18d Update README 2022-03-04 11:26:59 +01:00
Frank Jogeleit
f986377e36 Update Version 2022-03-04 11:22:31 +01:00
Frank Jogeleit
046e838b3a
Dependency Update ()
Dependency Update
2022-03-04 11:20:10 +01:00
Frank Jogeleit
31fad16908
Merge pull request from fjogeleit/dependabot/npm_and_yarn/follow-redirects-1.14.8
Bump follow-redirects from 1.14.7 to 1.14.8
2022-02-13 10:59:39 +01:00
dependabot[bot]
5c4179dc69
Bump follow-redirects from 1.14.7 to 1.14.8
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 06:50:19 +00:00
Frank Jogeleit
d45f6649f6
Merge pull request from Atlas-Authority/master
Support single file upload
2022-02-11 12:31:32 +01:00
Nhan Nguyen
f683177370 Support single file upload 2022-02-10 10:14:07 +07:00
Frank Jogeleit
a6980b2ca5
Merge pull request from fjogeleit/dependency-update
Dependency Update
2022-01-16 17:29:35 +01:00
Frank Jogeleit
70ee000b97 Dependency Update
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
2022-01-16 17:27:57 +01:00
Frank Jogeleit
5e30e204fc
Update README.md 2021-12-10 17:44:42 +01:00
Frank Jogeleit
82d22dd60f
Merge pull request from understructure/docs-update
docs: clarification that data can be entered as key value pairs under appropriate conditions
2021-10-12 23:20:13 +02:00
Matthew Cloney
1ea54adf35 docs: clarification that data can be entered as key value pairs under appropriate conditions 2021-10-12 16:57:47 -04:00
Frank Jogeleit
8e939c608a dependency updates
Signed-off-by: Frank Jogeleit <fj@move-elevator.de>
2021-09-09 14:42:30 +02:00
Frank Jogeleit
7c5a3f2e70
Merge pull request from fjogeleit/dependabot/npm_and_yarn/axios-0.21.2
Bump axios from 0.21.1 to 0.21.2
2021-09-09 14:30:28 +02:00
dependabot[bot]
78bba76cbe
Bump axios from 0.21.1 to 0.21.2
Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 11:38:52 +00:00
Frank Jogeleit
3e3e6b3eec
Update test.yml 2021-07-22 14:52:06 +02:00
Frank Jogeleit
0929a0c636
Ignored status codes ()
* Implement StatusCode ignore list
2021-03-19 17:28:53 +01:00
Frank Jogeleit
bd043fe286 Build new version 2021-02-19 12:51:47 +01:00
Frank Jogeleit
7626a13e42
Disable MaxContentLength and MaxBodyLength check ()
* Disable MaxContentLength and MaxBodyLength check
2021-02-19 11:36:10 +01:00
Scott W Harden
48dc3972df
more documentation with code sample ()
* improve debug logging documentation
* document how to log response content
* add syntax highlighting
* improve description

This action can be used to do more than just interact with Ansible AWS. I rephrased the description to emphasize its general utility.
2021-01-26 17:49:24 +01:00
Frank Jogeleit
84e61f1a56 Update version 2021-01-24 14:09:17 +01:00
Frank Jogeleit
42677b964e Update FileUpload ContentType 2021-01-24 13:52:05 +01:00
Frank Jogeleit
b6bb4fa030
File upload ()
* Add Support for FileUpload
2021-01-24 13:14:13 +01:00
Frank Jogeleit
de202bb090
Merge pull request from Hoopless/master
Changes to basic Example
2021-01-20 10:44:46 +01:00
Jasper
eff73a48f7
Update README.md 2021-01-20 00:21:04 +01:00
Frank Jogeleit
f91c5933c4 axios update 2021-01-05 18:57:45 +01:00
Frank Jogeleit
3a9531bb34
Dependency Update // Support none JSON Body ()
* Dependency Update // Support none JSON Body

* Specify action text case name
2020-12-16 21:37:11 +01:00
Frank Jogeleit
0cc64a5579
Support for unescaped newlines in data ()
* support newline escaping
2020-10-07 18:29:38 +02:00
Frank Jogeleit
81e44c2059 Update Dependencies 2020-10-01 22:20:08 +02:00
Frank Jogeleit
cc4fc855b5
Merge pull request from fjogeleit/dependabot/npm_and_yarn/actions/core-1.2.6
Bump @actions/core from 1.2.2 to 1.2.6
2020-10-01 22:16:26 +02:00
dependabot[bot]
c7cadd574f
Bump @actions/core from 1.2.2 to 1.2.6
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.2 to 1.2.6.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-01 17:32:37 +00:00
19 changed files with 36121 additions and 3078 deletions

10
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'

35
.github/workflows/build-action.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: Build Action
on:
workflow_dispatch:
inputs:
ref:
description: The branch
type: string
default: main
required: true
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install dependencies
run: |
npm ci
- name: Build Action
run: |
npm run build
- name: Update dist
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add ./dist &&
git commit -m "Update dist"
git push origin HEAD:${{ inputs.ref }}

71
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,71 @@
name: CI
on:
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
build:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- id: ref
run: |
if [[ -n '${{ github.event.ref }}' ]]; then
branch="${{ github.event.ref }}"
echo "branch=$branch" >> $GITHUB_OUTPUT
else
branch="${{ github.event.pull_request.head.ref }}"
echo "branch=$branch" >> $GITHUB_OUTPUT
fi
- name: checkout repo
uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install dependencies
run: |
npm ci
- name: Build Action
run: |
npm run build
- name: Update dist
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add ./dist
if ! git diff --quiet dist; then
git commit -m "Update dist"
git push origin HEAD:${{ steps.ref.outputs.branch }}
fi
integrity:
if: >
!failure() &&
!cancelled()
needs:
- build
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '16.17.0'
- name: Build action
run: |
npm ci
npm run build
- name: Repository Integrity Check
run: |
git diff --quiet dist

337
.github/workflows/it-tests.yml vendored Normal file
View file

@ -0,0 +1,337 @@
on:
pull_request:
push:
branches: [main]
jobs:
test-method-get-on-existing-url:
name: "IT Test - Request Postman Echo GET"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with GET and a valid URL
id: execution
uses: ./
with:
url: 'https://postman-echo.com/get'
method: 'GET'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-method-post-on-existing-url:
name: "IT Test - Request Postman Echo POST"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with POST using valid data
id: execution
uses: ./
with:
url: "https://postman-echo.com/post"
method: 'POST'
data: '{ "key": "value" }'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-method-post-on-existing-url-with-unescaped-newline:
name: "IT Test - Request Postman Echo POST with Unescaped Newline"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with POST using unescaped new line within data
id: execution
uses: ./
with:
url: "https://postman-echo.com/post"
method: 'POST'
escapeData: 'true'
data: >-
{
"key":"multi line\ntest
text"
}
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-basic-auth:
name: "IT Test - Request Postman Echo BasicAuth"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with valid BasicAuth parameters
id: execution
uses: ./
with:
url: 'https://postman-echo.com/basic-auth'
method: 'GET'
username: 'postman'
password: 'password'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200 as this URL exists
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-input-ignore-failure-code-404:
name: "IT Test - Request Postman Echo with 404 Response and ignore failure code"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with unknown URL and ignoreStatusCode 404 for it
id: execution
uses: ./
with:
url: 'https://postman-echo.com/status/404'
method: 'GET'
ignoreStatusCodes: '404'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must 404
with:
expected: '404'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then the outcome value must be success as the error 404 is ignored
with:
expected: 'success'
actual: ${{ steps.execution.outcome }}
comparison: exact
test-input-ignore-failure-multiple-codes-401-404:
name: "IT Test - Request Postman Echo with 404 Response and ignore failure code"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with unknown URL and ignore status codes 401,404
id: execution
uses: ./
with:
url: 'https://postman-echo.com/status/404'
method: 'GET'
ignoreStatusCodes: '401,404'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 404
with:
expected: '404'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then the outcome value must be success as the error 404 is ignored
with:
expected: 'success'
actual: ${{ steps.execution.outcome }}
comparison: exact
test-input-files:
name: "IT Test - Request Postman Echo POST Multipart"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Create Test File
run: |
echo "test" > testfile.txt
- name: Given the gh-action is used with file and data
id: execution
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
data: '{ "key": "value" }'
files: '{ "file": "${{ github.workspace }}/testfile.txt" }'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-input-responseFile:
name: "IT Test - Request Postman Echo POST and persist response"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Create Test File
run: |
echo "test" > testfile2.txt
- name: Given the gh-action is used with file and responseFile
id: execution
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
file: "${{ github.workspace }}/testfile2.txt"
responseFile: "${{ github.workspace }}/response.json"
- name: Output responseFile
id: execution-response-file
run: |
echo "response_content=$(cat ${{ github.workspace }}/response.json)" >> $GITHUB_OUTPUT
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.response_content value must include
with:
expected: '{"args":{},"data":"test\n","files":{},"form":{},"headers":{"host":"postman-echo.com",'
actual: ${{ steps.execution-response-file.outputs.response_content }}
comparison: contains
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.response_content value must include
with:
expected: '"accept":"application/json, text/plain, */*","content-type":"application/json","user-agent"'
actual: ${{ steps.execution-response-file.outputs.response_content }}
comparison: contains
test-input-files-without-data:
name: "IT Test - Request Postman Echo POST Multipart without data"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Create Test File
run: |
echo "test" > testfile3.txt
- name: Given the gh-action is used with file
id: execution
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
files: '{ "file": "${{ github.workspace }}/testfile3.txt" }'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-input-file-with-single-file:
name: "IT Test - Request Postman Echo POST single file"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Create Test File
run: |
echo "test" > testfile4.txt
- name: Given the gh-action is used with file
id: execution
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
file: "${{ github.workspace }}/testfile4.txt"
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-input-data-with-url-encoded-string:
name: "IT Test - Request Postman Echo POST URLEncoded string data"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with data form url encoded
id: execution
uses: ./
with:
url: 'https://postman-echo.com/post'
contentType : 'application/x-www-form-urlencoded'
method: 'POST'
data: 'key=value'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-input-data-with-url-encoded-json-data:
name: "IT Test - Request Postman Echo POST URLEncoded json data"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with json data
id: execution
uses: ./
with:
url: 'https://postman-echo.com/post'
contentType : 'application/x-www-form-urlencoded'
method: 'POST'
data: '{"key":"value"}'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
test-delete-http-method:
name: "IT Test - Request Postman Echo DELETE"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Given the gh-action is used with method DELETE
id: execution
uses: ./
with:
url: 'https://postman-echo.com/delete'
contentType : 'application/json'
method: 'DELETE'
data: '{"key":"value"}'
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2
name: Then outputs.status value must be 200
with:
expected: '200'
actual: ${{ steps.execution.outputs.status }}
comparison: exact
it-tests:
name: "All IT Tests have to pass"
runs-on: ubuntu-latest
if: always()
needs:
# Add your tests here so that they prevent the merge of broken changes
- test-method-get-on-existing-url
- test-method-post-on-existing-url
- test-method-post-on-existing-url-with-unescaped-newline
- test-basic-auth
- test-input-ignore-failure-code-404
- test-input-ignore-failure-multiple-codes-401-404
- test-input-files
- test-input-responseFile
- test-input-files-without-data
- test-input-file-with-single-file
- test-input-data-with-url-encoded-string
- test-input-data-with-url-encoded-json-data
- test-delete-http-method
steps:
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}

View file

@ -1,32 +0,0 @@
name: Test
on: [push, pull_request]
jobs:
request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Request Postment Echo GET
uses: ./
with:
url: 'https://postman-echo.com/get'
method: 'GET'
- name: Request Postment Echo POST
uses: ./
with:
url: 'https://postman-echo.com/post'
method: 'POST'
data: '{ "key": "value" }'
- name: Request Postment Echo BasicAuth
uses: ./
with:
url: 'https://postman-echo.com/basic-auth'
method: 'GET'
username: 'postman'
password: 'password'

1
.gitignore vendored
View file

@ -1 +1,2 @@
node_modules
.vscode

View file

@ -1,43 +1,106 @@
# HTTP Request Action
Create any kind of HTTP Requests in your GitHub actions to trigger Tools like Ansible AWX
**Create HTTP Requests from GitHub Actions.** This action allows GitHub events to engage with tools like Ansible AWX that use HTTP APIs.
Example Usage:
```
### Example
```yaml
jobs:
deployment
- name: Deploy Stage
uses: fjogeleit/http-request-action@master
with:
url: 'https://ansible.io/api/v2/job_templates/84/launch/'
method: 'POST'
username: ${{ secrets.AWX_USER }}
password: ${{ secrets.AWX_PASSWORD }}
deployment:
runs-on: ubuntu-latest
steps:
- name: Deploy Stage
uses: fjogeleit/http-request-action@v1
with:
url: 'https://ansible.io/api/v2/job_templates/84/launch/'
method: 'POST'
username: ${{ secrets.AWX_USER }}
password: ${{ secrets.AWX_PASSWORD }}
customHeaders: '{"Content-Type": "application/json"}'
data: '{"key_1": "value_1", "key_2": "value_2"}'
```
### Input Arguments
### Versioning
`master` branch is deprecated. Please use `main` or `v1` to get the latest version of this action. It is recommended to use a fixed version.
### Request Configuration
|Argument| Description | Default |
|--------|---------------|-----------|
|url | Request URL | _required_ Field |
|method | Request Method| POST |
|contentType | Request ContentType| application/json |
|data | Request Body Content as JSON String, only for POST / PUT / PATCH Requests | '{}' |
|data | Request Body Content:<br>- text content like JSON or XML<br>- key=value pairs separated by '&' or JSON data and contentType: application/x-www-form-urlencoded<br><br>only for POST / PUT / PATCH Requests | '{}' |
|files | Map of key / absolute file paths send as multipart/form-data request to the API, if set the contentType is set to multipart/form-data, values provided by data will be added as additional FormData values, nested objects are not supported. **Example provided in the _test_ Workflow of this Action** | '{}' |
|file | Single absolute file path send as `application/octet-stream` request to the API, if set the contentType is set to `application/octet-stream`. This input will be ignored if either `data` or `files` input is present. **Example provided in the _test_ Workflow of this Action** ||
|timeout| Request Timeout in ms | 5000 (5s) |
|username| Username for Basic Auth ||
|password| Password for Basic Auth ||
|bearerToken| Bearer Authentication Token (without Bearer Prefix) ||
|customHeaders| Additional header values as JSON string, keys in this object overwrite default headers like Content-Type |'{}'|
|escapeData| Escape newlines in data string content. Use 'true' (string) as value to enable it ||
|preventFailureOnNoResponse| Prevent this Action to fail if the request respond without an response. Use 'true' (string) as value to enable it ||
|ignoreStatusCodes| Prevent this Action to fail if the request respond with one of the configured Status Codes. Example: '404,401' ||
|httpsCA| Certificate authority as string in PEM format ||
|httpsCert| Client Certificate as string ||
|httpsKey| Client Certificate Key as string ||
|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 ||
|retryWait| time between each retry in millseconds | 3000 |
|ignoreSsl| ignore ssl verify (rejectUnauthorized: false) | false |
### Output
### Response
- `response` Request Response as JSON String
| Variable | Description |
|---|---|
`response` | Response as JSON String
`headers` | Headers
`status` | HTTP status message
To display HTTP response data in the GitHub Actions log give the request an `id` and access its `outputs`. You can also access specific field from the response data using [fromJson()](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson) expression.
### Debug Informations
```yaml
steps:
- name: Make Request
id: myRequest
uses: fjogeleit/http-request-action@v1
with:
url: "http://yoursite.com/api"
- name: Show Response
run: |
echo ${{ steps.myRequest.outputs.response }}
echo ${{ steps.myRequest.outputs.headers }}
echo ${{ steps.myRequest.outputs.status }}
echo ${{ fromJson(steps.myRequest.outputs.response).field_you_want_to_access }}
```
Enable Debug mode to get informations about
### Additional Information
Additional information is available if debug logging is enabled:
- Instance Configuration (Url / Timeout / Headers)
- Request Data (Body / Auth / Method)
To [enable debug logging in GitHub Actions](https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging) create a secret `ACTIONS_RUNNER_DEBUG` with a value of `true`
#### Local Usage
* You can execute this tool locally with the provided CLI `bin/http-action`.
```bash
bin/http-action --help
Positionals:
url request URL [string]
Optionen:
--help helper text [boolean]
-d, --data request body data [string] [default: "{}"]
-f, --files request files, send as multipart/form-data [string] [default: "{}"]
--file single file, send as application/octet-stream [string]
-h, --customHeaders custom request headers [string] [default: "{}"]
-m, --method request method (GET, POST, PATCH, PUT, DELETE) [string] [default: "POST"]
-t, --contentType request content type [string] [default: "application/json"]
--bearerToken bearer token without Bearer prefix, added as
Authorization header [string]
--timeout request timeout [number] [default: 5000]
```

View file

@ -11,11 +11,17 @@ inputs:
contentType:
description: 'Content Type'
required: false
default: 'application/json'
data:
description: 'Request Body as JSON String'
required: false
default: '{}'
files:
description: 'Map of absolute file paths as JSON String'
required: false
default: '{}'
file:
description: 'A single absolute file path'
required: false
username:
description: 'Auth Username'
required: false
@ -23,7 +29,7 @@ inputs:
description: 'Auth Password'
required: false
timeout:
description: 'Request Timeout in Sec'
description: 'Request Timeout in milliseconds'
required: false
default: '5000'
bearerToken:
@ -35,9 +41,44 @@ inputs:
preventFailureOnNoResponse:
description: 'Prevent this Action to fail if the request respond without an response'
required: false
ignoreStatusCodes:
description: 'Prevent this Action to fail if the request respond with one of the configured StatusCodes'
required: false
escapeData:
description: 'Escape newlines in data string content'
required: false
httpsCA:
description: 'Certificate authority as string in PEM format'
required: false
httpsCert:
description: 'Client Certificate as string'
required: false
httpsKey:
description: 'Client Certificate Key as string'
required: false
responseFile:
description: 'Persist the response data to the specified file path'
required: false
maskResponse:
description: 'Allows to mark your response as secret and hide the output in the action logs'
required: false
default: 'false'
retry:
description: 'optional amount of retries if the request fails'
required: false
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'
headers:
description: 'HTTP Response Headers'
status:
description: 'HTTP status message'
runs:
using: 'node12'
using: 'node20'
main: 'dist/index.js'

55
bin/http-action Executable file
View file

@ -0,0 +1,55 @@
#!/usr/bin/env node
const yargs = require('yargs/yargs')
const { hideBin } = require('yargs/helpers')
const { LogActions } = require('../src/githubActions.js')
const { request } = require('../src/httpClient');
const argv = yargs(hideBin(process.argv))
.option('data', { alias: 'd', type: 'string', description: 'request body data', default: '{}' })
.option('files', { alias: 'f', type: 'string', description: 'request files, send as multipart/form-data', default: '{}' })
.option('file', { type: 'string', description: 'single file, send as application/octet-stream' })
.option('customHeaders', { alias: 'h', type: 'string', description: 'custom request headers', default: '{}' })
.option('method', { alias: 'm', type: 'string', description: 'request method (GET, POST, PATCH, PUT, DELETE)', default: 'POST' })
.option('contentType', { alias: 't', type: 'string', description: 'request content type', default: 'application/json' })
.option('bearerToken', { type: 'string', description: 'bearer token without Bearer prefix, added as Authorization header' })
.option('timeout', { type: 'number', description: 'request timeout', default: 5000 })
.positional('url', { type: 'string', description: 'URL', description: 'request URL' })
.parse()
let customHeaders = {}
if (!!argv.customHeaders) {
try {
customHeaders = JSON.parse(argv.customHeaders);
} catch(error) {
console.error('Could not parse customHeaders string value')
}
}
const headers = { 'Content-Type': argv.contentType || 'application/json' }
if (!!argv.bearerToken) {
headers['Authorization'] = `Bearer ${argv.bearerToken}`;
}
const instanceConfig = {
baseURL: argv._[0],
timeout: parseInt(argv.timeout || 5000, 10),
headers: { ...headers, ...customHeaders }
}
request({
data: argv.data,
method: argv.method,
instanceConfig,
files: argv.files,
file: argv.file,
actions: new LogActions(),
options: {
ignoredCodes: [],
escapeData: false,
preventFailureOnNoResponse: false,
retry: 0,
retryWait: 0
}
})

37433
dist/index.js vendored

File diff suppressed because one or more lines are too long

618
package-lock.json generated
View file

@ -1,48 +1,594 @@
{
"name": "http-request-action",
"version": "1.4.0",
"lockfileVersion": 1,
"version": "1.16.4",
"lockfileVersion": 3,
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.2.tgz",
"integrity": "sha512-IbCx7oefq+Gi6FWbSs2Fnw8VkEI6Y4gvjrYprY3RV//ksq/KPMlClOerJ4jRosyal6zkUIc8R9fS/cpRMlGClg==",
"dev": true
},
"@zeit/ncc": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.21.1.tgz",
"integrity": "sha512-M9WzgquSOt2nsjRkYM9LRylBLmmlwNCwYbm3Up3PDEshfvdmIfqpFNSK8EJvR18NwZjGHE5z2avlDtYQx2JQnw=="
},
"axios": {
"version": "0.19.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz",
"integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==",
"requires": {
"follow-redirects": "1.5.10"
"packages": {
"": {
"name": "http-request-action",
"version": "1.16.4",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.11.1"
},
"devDependencies": {
"@vercel/ncc": "^0.38.3",
"axios": "^1.8",
"form-data": "^4.0.2",
"yargs": "^17.7.2"
},
"engines": {
"node": ">=16.0.0"
}
},
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
"node_modules/@actions/core": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
"license": "MIT",
"dependencies": {
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.0.1"
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
"node_modules/@actions/exec": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
"license": "MIT",
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
"node_modules/@actions/http-client": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz",
"integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==",
"license": "MIT",
"dependencies": {
"tunnel": "^0.0.6",
"undici": "^5.25.4"
}
},
"node_modules/@actions/io": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==",
"license": "MIT"
},
"node_modules/@fastify/busboy": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz",
"integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==",
"license": "MIT",
"engines": {
"node": ">=14"
}
},
"node_modules/@vercel/ncc": {
"version": "0.38.3",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz",
"integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==",
"dev": true,
"license": "MIT",
"bin": {
"ncc": "dist/ncc/cli.js"
}
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true,
"license": "MIT"
},
"node_modules/axios": {
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz",
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==",
"dev": true,
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/call-bind-apply-helpers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/cliui": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
"dev": true,
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.1",
"wrap-ansi": "^7.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"license": "MIT"
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"license": "MIT",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
"dev": true,
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-errors": "^1.3.0",
"gopd": "^1.2.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true,
"license": "MIT"
},
"node_modules/es-define-property": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-object-atoms": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-set-tostringtag": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.6",
"has-tostringtag": "^1.0.2",
"hasown": "^2.0.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/escalade": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/follow-redirects": {
"version": "1.15.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"license": "MIT",
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz",
"integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
"dev": true,
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true,
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/get-intrinsic": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz",
"integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==",
"dev": true,
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-define-property": "^1.0.1",
"es-errors": "^1.3.0",
"es-object-atoms": "^1.0.0",
"function-bind": "^1.1.2",
"get-proto": "^1.0.0",
"gopd": "^1.2.0",
"has-symbols": "^1.1.0",
"hasown": "^2.0.2",
"math-intrinsics": "^1.1.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"dunder-proto": "^1.0.1",
"es-object-atoms": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-tostringtag": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
"dev": true,
"license": "MIT",
"dependencies": {
"has-symbols": "^1.0.3"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/hasown": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dev": true,
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"dev": true,
"license": "MIT"
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
"license": "MIT",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"node_modules/undici": {
"version": "5.28.5",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz",
"integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==",
"license": "MIT",
"dependencies": {
"@fastify/busboy": "^2.0.0"
},
"engines": {
"node": ">=14.0"
}
},
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/y18n": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=10"
}
},
"node_modules/yargs": {
"version": "17.7.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
"integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
"dev": true,
"license": "MIT",
"dependencies": {
"cliui": "^8.0.1",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.3",
"y18n": "^5.0.5",
"yargs-parser": "^21.1.1"
},
"engines": {
"node": ">=12"
}
},
"node_modules/yargs-parser": {
"version": "21.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=12"
}
}
}
}

View file

@ -1,6 +1,6 @@
{
"name": "http-request-action",
"version": "1.4.0",
"version": "1.16.4",
"description": "",
"main": "src/index.js",
"private": false,
@ -13,16 +13,21 @@
},
"keywords": [],
"author": "",
"license": "ISC",
"license": "MIT",
"bugs": {
"url": "https://github.com/fjogeleit/http-request-action/issues"
},
"homepage": "https://github.com/fjogeleit/http-request-action#readme",
"devDependencies": {
"@actions/core": "^1.2.2"
"@vercel/ncc": "^0.38.3",
"axios": "^1.8",
"form-data": "^4.0.2",
"yargs": "^17.7.2"
},
"dependencies": {
"@zeit/ncc": "^0.21.1",
"axios": "^0.19.2"
"@actions/core": "^1.11.1"
},
"engines": {
"node": ">=16.0.0"
}
}

View file

@ -1,3 +1,5 @@
'use strict'
const core = require("@actions/core");
class GithubActions {
@ -5,6 +7,10 @@ class GithubActions {
core.debug(message)
}
info(message) {
core.info(message)
}
warning(message) {
core.warning(message)
}
@ -13,12 +19,20 @@ class GithubActions {
core.setOutput(name, output)
}
setSecret(value) {
core.setSecret(value)
}
setFailed(message) {
core.setFailed(message)
}
}
class LogActions {
info(message) {
console.info(message)
}
debug(message) {
console.info(message)
}

15
src/handler/mask.js Normal file
View file

@ -0,0 +1,15 @@
'use strict'
const axios = require('axios');
const { GithubActions } = require('../githubActions');
/**
* @param {GithubActions} actions
*
* @returns {(response: axios.AxiosResponse) => void}
*/
const createMaskHandler = (actions) => (response) => {
actions.setSecret(JSON.stringify(response.data))
}
module.exports = { createMaskHandler }

17
src/handler/output.js Normal file
View file

@ -0,0 +1,17 @@
'use strict'
const axios = require('axios');
const { GithubActions } = require('../githubActions');
/**
* @param {GithubActions} actions
*
* @returns {(response: axios.AxiosResponse) => void}
*/
const createOutputHandler = (actions) => (response) => {
actions.setOutput('response', JSON.stringify(response.data))
actions.setOutput('headers', response.headers)
actions.setOutput('status', response.status)
}
module.exports = { createOutputHandler }

30
src/handler/persist.js Normal file
View file

@ -0,0 +1,30 @@
'use strict'
const axios = require('axios');
const fs = require('fs');
const { GithubActions } = require('../githubActions');
/**
* @param {string} filePath
* @param {GithubActions} actions
*
* @returns {(response: axios.AxiosResponse) => void}
*/
const createPersistHandler = (filePath, actions) => (response) => {
let data = response.data
if (typeof data == 'object') {
data = JSON.stringify(data)
}
fs.writeFile(filePath, data, error => {
if (!error) {
actions.info(`response persisted successfully at ${filePath}`)
return
}
actions.warning(JSON.stringify({ message: error.message, data: response.data }))
})
}
module.exports = { createPersistHandler }

77
src/helper.js Normal file
View file

@ -0,0 +1,77 @@
'use strict';
const { GithubActions } = require('./githubActions');
const FormData = require('form-data');
const fs = require('fs');
/**
* @param {string} value
*
* @returns {Object}
*/
const convertToJSON = (value) => {
try {
return JSON.parse(value) || {};
} catch (e) {
return {};
}
};
/**
* @param {{ [key: string]: string }} data
* @param {{ [key: string]: string }} files
* @param {boolean} convertPaths
*
* @returns {FormData}
*/
const convertToFormData = (data, files) => {
const formData = new FormData();
for (const [key, value] of Object.entries(data)) {
formData.append(key, value);
}
for (const [key, value] of Object.entries(files)) {
formData.append(key, fs.createReadStream(value));
}
return formData;
};
/**
* @param {() => Promise} callback
* @param {{ retry: number; sleep: number; actions: GithubActions }} options
*
* @returns {Promise}
*/
const retry = async (callback, options) => {
let lastErr = null;
let i = 0;
do {
try {
return await callback();
} catch (err) {
lastErr = err;
}
if (i < options.retry) {
options.actions.warning(`#${i + 1} request failed: ${lastErr}`);
await sleep(options.sleep);
}
i++;
} while (i <= options.retry);
throw lastErr;
};
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}
module.exports = {
convertToJSON,
convertToFormData,
retry,
};

View file

@ -1,42 +1,210 @@
const axios = require("axios");
'use strict'
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const url = require('url');
const { GithubActions } = require('./githubActions');
const { convertToJSON, convertToFormData, retry } = require('./helper');
const METHOD_GET = 'GET'
const METHOD_POST = 'POST'
const request = async({ method, instanceConfig, data, auth, actions, preventFailureOnNoResponse }) => {
try {
const instance = axios.create(instanceConfig);
const HEADER_CONTENT_TYPE = 'Content-Type'
const jsonData = method === METHOD_GET ? undefined : JSON.parse(data)
const CONTENT_TYPE_URLENCODED = 'application/x-www-form-urlencoded'
/**
* @param {Object} param0
* @param {string} param0.method HTTP Method
* @param {axios.AxiosRequestConfig} param0.instanceConfig
* @param {string} param0.data Request Body as string, default {}
* @param {string} param0.files Map of Request Files (name: absolute path) as JSON String, default: {}
* @param {string} param0.file Single request file (absolute path)
* @param {GithubActions} param0.actions
* @param {{
* ignoredCodes: number[];
* preventFailureOnNoResponse: boolean,
* escapeData: boolean;
* retry: number;
* retryWait: number;
* }} param0.options
*
* @returns {Promise<axios.AxiosResponse>}
*/
const request = async({ method, instanceConfig, data, files, file, actions, options }) => {
actions.debug(`options: ${JSON.stringify(options)}`)
try {
if (options.escapeData) {
data = data.replace(/"[^"]*"/g, (match) => {
return match.replace(/[\n\r]\s*/g, "\\n");
});
}
if (method === METHOD_GET) {
data = undefined;
}
if (files && files !== '{}') {
let filesJson = convertToJSON(files)
let dataJson = convertToJSON(data)
if (Object.keys(filesJson).length > 0) {
try {
data = convertToFormData(dataJson, filesJson)
} catch(error) {
actions.setFailed(JSON.stringify({ message: `Unable to convert Data and Files into FormData: ${error.message}`, data: dataJson, files: filesJson }))
return
}
try {
instanceConfig = await updateConfig(instanceConfig, data)
} catch(error) {
actions.setFailed(JSON.stringify({ message: `Unable to read Content-Length: ${error.message}` }))
return
}
}
}
// Only consider file if neither data nor files provided
if ((!data || data === '{}') && (!files || files === '{}') && file) {
data = fs.createReadStream(file)
updateConfigForFile(instanceConfig, file, actions)
}
if (instanceConfig.headers[HEADER_CONTENT_TYPE] === CONTENT_TYPE_URLENCODED) {
let dataJson = convertToJSON(data)
if (typeof dataJson === 'object' && Object.keys(dataJson).length) {
data = (new url.URLSearchParams(dataJson)).toString();
}
}
const requestData = {
auth,
method,
data: jsonData
data,
maxContentLength: Infinity,
maxBodyLength: Infinity
}
actions.debug('Instance Configuration: ' + JSON.stringify(instanceConfig))
/** @type {axios.AxiosInstance} */
const instance = axios.create(instanceConfig);
actions.debug('Request Data: ' + JSON.stringify(requestData))
const response = await instance.request(requestData)
const execRequest = async () => {
try {
return await instance.request(requestData)
} catch(error) {
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.setOutput('response', JSON.stringify(response.data))
return error.response
}
if (!error.response && error.request && options.preventFailureOnNoResponse) {
actions.warning(`no response received: ${JSON.stringify(error)}`);
return null
}
throw error
}
}
/** @type {axios.AxiosResponse|null} */
const response = await retry(execRequest, {
actions,
retry: options.retry || 0,
sleep: options.retryWait // wait time after each retry
})
if (!response) {
return null
}
return response
} catch (error) {
if (error.toJSON) {
actions.setOutput(JSON.stringify(error.toJSON()));
if ((typeof error === 'object') && (error.isAxiosError === true)) {
const { name, message, code, response } = error
actions.setOutput('requestError', JSON.stringify({ name, message, code, status: response && response.status ? response.status : null }));
}
if (error.response) {
actions.setFailed(JSON.stringify({ code: error.response.code, message: error.response.data }))
} else if (error.request && !preventFailureOnNoResponse) {
actions.setFailed(JSON.stringify({ error: "no response received" }));
} else if (error.request && preventFailureOnNoResponse) {
actions.warning(JSON.stringify(error));
actions.setFailed(JSON.stringify({ code: error.response.status, message: error.response.data }))
} else if (error.request) {
actions.setFailed(JSON.stringify({ error: "no response received", message: error.message }));
} else {
actions.setFailed(error.message);
actions.setFailed(JSON.stringify({ message: error.message, data }));
}
}
}
/**
* @param {{ baseURL: string; timeout: number; headers: { [name: string]: string } }} instanceConfig
* @param {FormData} formData
*
* @returns {Promise<{ baseURL: string; timeout: number; headers: { [name: string]: string } }>}
*/
const updateConfig = async (instanceConfig, formData) => {
const formHeaders = formData.getHeaders()
const contentType = formHeaders['content-type']
delete formHeaders['content-type']
return {
...instanceConfig,
headers: {
...instanceConfig.headers,
...formHeaders,
'Content-Length': await contentLength(formData),
'Content-Type': contentType
}
}
}
/**
* @param instanceConfig
* @param filePath
* @param {*} actions
*
* @returns {{ baseURL: string; timeout: number; headers: { [name: string]: string } }}
*/
const updateConfigForFile = (instanceConfig, filePath, actions) => {
try {
const { size } = fs.statSync(filePath)
return {
...instanceConfig,
headers: {
...instanceConfig.headers,
'Content-Length': size,
'Content-Type': 'application/octet-stream'
}
}
} catch(error) {
actions.setFailed({ message: `Unable to read Content-Length: ${error.message}`, data, files })
}
}
/**
* @param {FormData} formData
*
* @returns {Promise<number>}
*/
const contentLength = (formData) => new Promise((resolve, reject) => {
formData.getLength((error, length) => {
if (error) {
reject(error)
return
}
resolve(length)
})
})
module.exports = {
request,
METHOD_POST,

View file

@ -1,43 +1,108 @@
const core = require("@actions/core");
'use strict'
const core = require('@actions/core');
const axios = require('axios');
const https = require('https');
const { request, METHOD_POST } = require('./httpClient');
const { GithubActions } = require('./githubActions');
let auth = undefined
const { createPersistHandler } = require('./handler/persist');
const { createOutputHandler } = require('./handler/output');
const { createMaskHandler } = require('./handler/mask');
let customHeaders = {}
if (!!core.getInput('customHeaders')) {
try {
customHeaders = JSON.parse(core.getInput('customHeaders'));
} catch(error) {
core.error('Could not parse customHeaders string value')
core.debug(`Invalid customHeaders string: ${core.getInput('customHeaders')}`)
core.error(`Could not parse customHeaders string value: ${error}`)
}
}
const headers = { 'Content-Type': core.getInput('contentType') || 'application/json' }
if (!!core.getInput('username') || !!core.getInput('password')) {
core.debug('Add BasicHTTP Auth config')
auth = {
username: core.getInput('username'),
password: core.getInput('password')
}
}
if (!!core.getInput('bearerToken')) {
headers['Authorization'] = `Bearer ${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 }
}
core.debug('Instance Configuration: ' + JSON.stringify(instanceConfig))
if (!!core.getInput('httpsCA') || !!core.getInput('httpsCert')) {
instanceConfig.httpsAgent = new https.Agent({
ca: core.getInput('httpsCA') || undefined,
cert: core.getInput('httpsCert') || undefined,
key: core.getInput('httpsKey') || undefined
})
}
if (!!core.getInput('username') || !!core.getInput('password')) {
core.debug('Add BasicHTTP Auth config')
instanceConfig.auth = {
username: core.getInput('username'),
password: core.getInput('password')
}
}
let retry = 0
if (!!core.getInput('retry')) {
retry = parseInt(core.getInput('retry'))
}
let retryWait = 3000
if (!!core.getInput('retryWait')) {
retryWait = parseInt(core.getInput('retryWait'))
}
const data = core.getInput('data') || '{}';
const files = core.getInput('files') || '{}';
const file = core.getInput('file')
const responseFile = core.getInput('responseFile')
const method = core.getInput('method') || METHOD_POST;
const preventFailureOnNoResponse = core.getInput('preventFailureOnNoResponse') === 'true';
const escapeData = core.getInput('escapeData') === 'true';
request({ data, method, instanceConfig, auth, preventFailureOnNoResponse, actions: new GithubActions() })
const ignoreStatusCodes = core.getInput('ignoreStatusCodes');
let ignoredCodes = [];
if (typeof ignoreStatusCodes === 'string' && ignoreStatusCodes.length > 0) {
ignoredCodes = ignoreStatusCodes.split(',').map(statusCode => parseInt(statusCode.trim()))
}
const actions = new GithubActions();
const handler = [];
if (core.getBooleanInput('maskResponse')) {
handler.push(createMaskHandler(actions))
}
handler.push(createOutputHandler(actions))
if (!!responseFile) {
handler.push(createPersistHandler(responseFile, actions))
}
const options = {
ignoredCodes,
preventFailureOnNoResponse,
escapeData,
retry,
retryWait
}
request({ data, method, instanceConfig, files, file, actions, options }).then(response => {
if (response && typeof response == 'object') {
handler.forEach(h => h(response))
}
})