mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2024-12-22 20:32:33 +00:00
jsdoc: async functions should return Promise (#70)
* 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>
This commit is contained in:
parent
05a08b70e2
commit
d00a8759d6
6 changed files with 7107 additions and 5496 deletions
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
|
@ -9,6 +9,9 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
if: >
|
||||
github.event_name == 'pull_request' &&
|
||||
github.event.pull_request.user.login == 'dependabot[bot]'
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -44,10 +47,35 @@ jobs:
|
|||
git commit -m "Update dist"
|
||||
git push origin HEAD:${{ steps.ref.outputs.branch }}
|
||||
fi
|
||||
test:
|
||||
integrity:
|
||||
if: >
|
||||
!failure() &&
|
||||
!cancelled()
|
||||
needs:
|
||||
- build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.17.0'
|
||||
- name: Build action
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
- name: Repository Integrity Check
|
||||
run: |
|
||||
git diff --quiet dist
|
||||
test:
|
||||
if: >
|
||||
!failure() &&
|
||||
!cancelled()
|
||||
needs:
|
||||
- integrity
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
|
12537
dist/index.js
vendored
12537
dist/index.js
vendored
File diff suppressed because one or more lines are too long
24
package-lock.json
generated
24
package-lock.json
generated
|
@ -9,12 +9,15 @@
|
|||
"version": "1.11.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.9.1"
|
||||
"@actions/core": "^1.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@zeit/ncc": "^0.22",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"axios": "^1.1.3",
|
||||
"form-data": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
|
@ -34,11 +37,10 @@
|
|||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@zeit/ncc": {
|
||||
"version": "0.22.3",
|
||||
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.3.tgz",
|
||||
"integrity": "sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ==",
|
||||
"deprecated": "@zeit/ncc is no longer maintained. Please use @vercel/ncc instead.",
|
||||
"node_modules/@vercel/ncc": {
|
||||
"version": "0.34.0",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
|
||||
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"ncc": "dist/ncc/cli.js"
|
||||
|
@ -178,10 +180,10 @@
|
|||
"tunnel": "^0.0.6"
|
||||
}
|
||||
},
|
||||
"@zeit/ncc": {
|
||||
"version": "0.22.3",
|
||||
"resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.3.tgz",
|
||||
"integrity": "sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ==",
|
||||
"@vercel/ncc": {
|
||||
"version": "0.34.0",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
|
||||
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
|
|
|
@ -19,11 +19,14 @@
|
|||
},
|
||||
"homepage": "https://github.com/fjogeleit/http-request-action#readme",
|
||||
"devDependencies": {
|
||||
"@zeit/ncc": "^0.22",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"axios": "^1.1.3",
|
||||
"form-data": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.9.1"
|
||||
"@actions/core": "^1.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ const CONTENT_TYPE_URLENCODED = 'application/x-www-form-urlencoded'
|
|||
* @param {boolean} param0.preventFailureOnNoResponse Prevent Action to fail if the API respond without Response
|
||||
* @param {boolean} param0.escapeData Escape unescaped JSON content in data
|
||||
*
|
||||
* @returns {void}
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
const request = async({ method, instanceConfig, data, files, file, actions, ignoredCodes, preventFailureOnNoResponse, escapeData }) => {
|
||||
try {
|
||||
|
@ -140,7 +140,7 @@ const convertToFormData = (data, files) => {
|
|||
* @param {FormData} formData
|
||||
* @param {*} actions
|
||||
*
|
||||
* @returns {{ baseURL: string; timeout: number; headers: { [name: string]: string } }}
|
||||
* @returns {Promise<{ baseURL: string; timeout: number; headers: { [name: string]: string } }>}
|
||||
*/
|
||||
const updateConfig = async (instanceConfig, formData, actions) => {
|
||||
try {
|
||||
|
|
|
@ -4,7 +4,6 @@ const https = require('https');
|
|||
const { request, METHOD_POST } = require('./httpClient');
|
||||
const { GithubActions } = require('./githubActions');
|
||||
|
||||
let auth = undefined
|
||||
let customHeaders = {}
|
||||
|
||||
if (!!core.getInput('customHeaders')) {
|
||||
|
|
Loading…
Reference in a new issue