Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.2 #24

Merged
merged 27 commits into from
Aug 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
00f9588
Convert action to ts
joelwmale Aug 25, 2020
600d4f0
Small fixes to action.yml and action output
joelwmale Aug 25, 2020
e4e62ab
Add node_modules until bundler is added
joelwmale Aug 25, 2020
1cbd7b0
Add node-fetch
joelwmale Aug 26, 2020
f43e864
Remove fetch, add axios
joelwmale Aug 26, 2020
0740593
Update build
joelwmale Aug 26, 2020
a2c63f8
Fix issue with res.status being undefined
joelwmale Aug 26, 2020
d4413d8
Update logging for debug purposes
joelwmale Aug 26, 2020
cfebc00
Attempt to fix missing status code output
joelwmale Aug 26, 2020
db36b9f
Attempt to have code wait for request to finish
joelwmale Aug 26, 2020
5be5ae3
Prepare for release
joelwmale Aug 26, 2020
d3ff660
Allow optional headers & body
joelwmale Aug 26, 2020
a2d3f9a
v2.0.0
joelwmale Aug 26, 2020
e22e83d
Merge branch 'master' into develop
joelwmale Aug 27, 2020
517289c
Add support for environment variables (fixed #17) (#19)
AnandChowdhary Aug 27, 2020
1d93074
Bump @actions/core from 1.2.4 to 1.2.5 (#18)
dependabot[bot] Aug 27, 2020
f91ad44
Bump @vercel/ncc from 0.23.0 to 0.24.0 (#16)
dependabot[bot] Aug 27, 2020
ebddbc5
Bump prettier from 2.0.5 to 2.1.1 (#15)
dependabot[bot] Aug 27, 2020
9fa1db0
:arrow_up: Bump typescript from 3.9.7 to 4.0.2 (#13)
dependabot[bot] Aug 27, 2020
01d242f
v2.0.1
joelwmale Aug 27, 2020
0c4ba5b
Add backwards compatibility
joelwmale Aug 27, 2020
aff8b23
Add support for failing check on HTTP error responses (#23)
AnandChowdhary Aug 29, 2020
144f9e1
v2.0.2
joelwmale Aug 29, 2020
2546cab
Bump @types/node from 14.6.0 to 14.6.1 (#21)
dependabot[bot] Aug 29, 2020
ee5a04d
Update @types/node from 14.6.0 to 14.6.1
joelwmale Aug 29, 2020
d6634a0
Merge branch 'master' into develop
joelwmale Aug 29, 2020
b77b2b8
Merge master -> develop
joelwmale Aug 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/@types/node/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 21 additions & 27 deletions node_modules/@types/node/async_hooks.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/@types/node/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified node_modules/@vercel/ncc/dist/ncc/cli.js.cache
Binary file not shown.
Binary file modified node_modules/@vercel/ncc/dist/ncc/index.js.cache
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@types/jest": "^26.0.10",
"@types/node": "^14.6.0",
"@types/node": "^14.6.1",
"@typescript-eslint/parser": "^3.9.1",
"@vercel/ncc": "^0.24.0",
"eslint": "^7.5.0",
Expand Down
19 changes: 16 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ async function run() {
if (!url) {
// validate a url
core.setFailed('A url is required to run this action.');
return;
// error
throw new Error('A url is required to run this action.');
}

// initial info
Expand All @@ -21,6 +22,12 @@ async function run() {
// make the request
http.make(url, headers, body)
.then((res) => {
// if the status code is not 2xx
if (res.status >= 400) {
// throw an error
error(res.status);
}

// output the status
core.setOutput('statusCode', res.status);
// report on the status code
Expand All @@ -29,9 +36,15 @@ async function run() {
core.info((new Date()).toTimeString());
})
.catch((err) => {
// set the action to failed
core.setFailed(`Received status code: ${err.status}`);
error(err.status);
});
}

function error(statusCode) {
// set the action to failed
core.setFailed(`Received status code: ${statusCode}`);
// throw an error
throw new Error(`Request failed with status code: ${statusCode}`);
}

run();
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=

"@types/node@^14.6.0":
version "14.6.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.0.tgz#7d4411bf5157339337d7cff864d9ff45f177b499"
integrity sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==
"@types/node@^14.6.1":
version "14.6.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.1.tgz#fdf6f6c6c73d3d8eee9c98a9a0485bc524b048d7"
integrity sha512-HnYlg/BRF8uC1FyKRFZwRaCPTPYKa+6I8QiUZFLredaGOou481cgFS4wKRFyKvQtX8xudqkSdBczJHIYSQYKrQ==

"@types/yargs-parser@*":
version "15.0.0"
Expand Down