Compare commits

...

5 Commits

Author SHA1 Message Date
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 (#151)
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 (#149)
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 (#148)
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 (#147)
* Add status to outputs

* add response.status info to readme

* build new version
2024-05-04 06:59:04 +02:00
6 changed files with 1162 additions and 806 deletions

View File

@@ -56,6 +56,7 @@ jobs:
|---|---| |---|---|
`response` | Response as JSON String `response` | Response as JSON String
`headers` | Headers `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. 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.
@@ -70,6 +71,7 @@ steps:
run: | run: |
echo ${{ steps.myRequest.outputs.response }} echo ${{ steps.myRequest.outputs.response }}
echo ${{ steps.myRequest.outputs.headers }} echo ${{ steps.myRequest.outputs.headers }}
echo ${{ steps.myRequest.outputs.status }}
echo ${{ fromJson(steps.myRequest.outputs.response).field_you_want_to_access }} echo ${{ fromJson(steps.myRequest.outputs.response).field_you_want_to_access }}
``` ```

View File

@@ -77,6 +77,8 @@ outputs:
description: 'HTTP Response Content' description: 'HTTP Response Content'
headers: headers:
description: 'HTTP Response Headers' description: 'HTTP Response Headers'
status:
description: 'HTTP status message'
runs: runs:
using: 'node20' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'

1951
dist/index.js vendored

File diff suppressed because one or more lines are too long

8
package-lock.json generated
View File

@@ -13,7 +13,7 @@
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.38.1", "@vercel/ncc": "^0.38.1",
"axios": "^1.6", "axios": "^1.7",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"yargs": "^17.7.2" "yargs": "^17.7.2"
}, },
@@ -87,9 +87,9 @@
"dev": true "dev": true
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.6.8", "version": "1.7.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz",
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.6", "follow-redirects": "^1.15.6",

View File

@@ -20,7 +20,7 @@
"homepage": "https://github.com/fjogeleit/http-request-action#readme", "homepage": "https://github.com/fjogeleit/http-request-action#readme",
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.38.1", "@vercel/ncc": "^0.38.1",
"axios": "^1.6", "axios": "^1.7",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"yargs": "^17.7.2" "yargs": "^17.7.2"
}, },

View File

@@ -11,6 +11,7 @@ const { GithubActions } = require('../githubActions');
const createOutputHandler = (actions) => (response) => { const createOutputHandler = (actions) => (response) => {
actions.setOutput('response', JSON.stringify(response.data)) actions.setOutput('response', JSON.stringify(response.data))
actions.setOutput('headers', response.headers) actions.setOutput('headers', response.headers)
actions.setOutput('status', response.status)
} }
module.exports = { createOutputHandler } module.exports = { createOutputHandler }