Compare commits

...

15 Commits

Author SHA1 Message Date
Frank Jogeleit
23ad54bcd1 Merge pull request #173 from fjogeleit/dependency-updates
Some checks failed
/ IT Test - Request Postman Echo POST Multipart (push) Has been cancelled
/ IT Test - Request Postman Echo POST and persist response (push) Has been cancelled
CI / build (push) Has been cancelled
/ IT Test - Request Postman Echo GET (push) Has been cancelled
/ IT Test - Request Postman Echo POST (push) Has been cancelled
/ IT Test - Request Postman Echo POST Multipart without data (push) Has been cancelled
/ IT Test - Request Postman Echo POST with Unescaped Newline (push) Has been cancelled
/ IT Test - Request Postman Echo BasicAuth (push) Has been cancelled
/ IT Test - Request Postman Echo POST single file (push) Has been cancelled
/ IT Test - Request Postman Echo with 404 Response and ignore failure code (push) Has been cancelled
/ IT Test - Request Postman Echo POST URLEncoded string data (push) Has been cancelled
/ IT Test - Request Postman Echo POST URLEncoded json data (push) Has been cancelled
/ IT Test - Request Postman Echo DELETE (push) Has been cancelled
CI / integrity (push) Has been cancelled
/ All IT Tests have to pass (push) Has been cancelled
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 #171 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 #172 from fjogeleit/dependabot/npm_and_yarn/axios-1.7.8
Some checks failed
CI / build (push) Has been cancelled
/ IT Test - Request Postman Echo GET (push) Has been cancelled
/ IT Test - Request Postman Echo POST (push) Has been cancelled
/ IT Test - Request Postman Echo POST with Unescaped Newline (push) Has been cancelled
/ IT Test - Request Postman Echo BasicAuth (push) Has been cancelled
/ IT Test - Request Postman Echo with 404 Response and ignore failure code (push) Has been cancelled
/ IT Test - Request Postman Echo POST Multipart (push) Has been cancelled
/ IT Test - Request Postman Echo POST and persist response (push) Has been cancelled
/ IT Test - Request Postman Echo POST Multipart without data (push) Has been cancelled
/ IT Test - Request Postman Echo POST single file (push) Has been cancelled
/ IT Test - Request Postman Echo POST URLEncoded string data (push) Has been cancelled
/ IT Test - Request Postman Echo POST URLEncoded json data (push) Has been cancelled
/ IT Test - Request Postman Echo DELETE (push) Has been cancelled
CI / integrity (push) Has been cancelled
/ All IT Tests have to pass (push) Has been cancelled
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 #170 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 #169 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
5 changed files with 2189 additions and 1489 deletions

3589
dist/index.js vendored

File diff suppressed because one or more lines are too long

62
package-lock.json generated
View File

@@ -1,20 +1,20 @@
{
"name": "http-request-action",
"version": "1.14.2",
"version": "1.16.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "http-request-action",
"version": "1.14.2",
"version": "1.16.2",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.1"
"@actions/core": "^1.11.1"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1",
"@vercel/ncc": "^0.38.3",
"axios": "^1.7",
"form-data": "^4.0.0",
"form-data": "^4.0.1",
"yargs": "^17.7.2"
},
"engines": {
@@ -22,13 +22,22 @@
}
},
"node_modules/@actions/core": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
"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/http-client": "^2.0.1",
"uuid": "^8.3.2"
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.0.1"
}
},
"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"
}
},
"node_modules/@actions/http-client": {
@@ -41,6 +50,12 @@
"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",
@@ -51,9 +66,9 @@
}
},
"node_modules/@vercel/ncc": {
"version": "0.38.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz",
"integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==",
"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": {
@@ -94,9 +109,9 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "1.7.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
"version": "1.7.9",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
"integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -202,9 +217,9 @@
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz",
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -325,15 +340,6 @@
"node": ">=14.0"
}
},
"node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",

View File

@@ -1,6 +1,6 @@
{
"name": "http-request-action",
"version": "1.14.2",
"version": "1.16.4",
"description": "",
"main": "src/index.js",
"private": false,
@@ -19,13 +19,13 @@
},
"homepage": "https://github.com/fjogeleit/http-request-action#readme",
"devDependencies": {
"@vercel/ncc": "^0.38.1",
"@vercel/ncc": "^0.38.3",
"axios": "^1.7",
"form-data": "^4.0.0",
"form-data": "^4.0.1",
"yargs": "^17.7.2"
},
"dependencies": {
"@actions/core": "^1.10.1"
"@actions/core": "^1.11.1"
},
"engines": {
"node": ">=16.0.0"

View File

@@ -24,7 +24,7 @@ const convertToJSON = (value) => {
*
* @returns {FormData}
*/
const convertToFormData = (data, files, convertPaths) => {
const convertToFormData = (data, files) => {
const formData = new FormData();
for (const [key, value] of Object.entries(data)) {

View File

@@ -53,11 +53,17 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti
if (Object.keys(filesJson).length > 0) {
try {
data = convertToFormData(dataJson, filesJson)
instanceConfig = await updateConfig(instanceConfig, data, actions)
} 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
}
}
}
@@ -129,7 +135,7 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti
if (error.response) {
actions.setFailed(JSON.stringify({ code: error.response.status, message: error.response.data }))
} else if (error.request) {
actions.setFailed(JSON.stringify({ error: "no response received" }));
actions.setFailed(JSON.stringify({ error: "no response received", message: error.message }));
} else {
actions.setFailed(JSON.stringify({ message: error.message, data }));
}
@@ -139,12 +145,10 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti
/**
* @param {{ baseURL: string; timeout: number; headers: { [name: string]: string } }} instanceConfig
* @param {FormData} formData
* @param {*} actions
*
* @returns {Promise<{ baseURL: string; timeout: number; headers: { [name: string]: string } }>}
*/
const updateConfig = async (instanceConfig, formData, actions) => {
try {
const updateConfig = async (instanceConfig, formData) => {
const formHeaders = formData.getHeaders()
const contentType = formHeaders['content-type']
@@ -159,9 +163,6 @@ const updateConfig = async (instanceConfig, formData, actions) => {
'Content-Type': contentType
}
}
} catch(error) {
actions.setFailed({ message: `Unable to read Content-Length: ${error.message}`, data, files })
}
}
/**