-
Notifications
You must be signed in to change notification settings - Fork 1.4k
consume getJson function for better error messages #110
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
Conversation
a7a7e99
to
2cb5914
Compare
2cb5914
to
cf70565
Compare
@@ -22,7 +22,6 @@ jobs: | |||
- run: npm ci | |||
- run: npm run build | |||
- run: npm run format-check | |||
- run: npm run pack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run build
now runs ncc
@@ -5,12 +5,11 @@ | |||
"description": "setup node action", | |||
"main": "lib/setup-node.js", | |||
"scripts": { | |||
"build": "tsc", | |||
"build": "tsc && ncc build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aligned with the pattern set by setup-ruby
); | ||
let body = await response.readBody(); | ||
let nodeVersions = JSON.parse(body) as INodeVersion[]; | ||
let response = await httpClient.getJson<INodeVersion[]>(dataUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getJson now checks for errors, so i removed the error checking code here
let body = await response.readBody(); | ||
let nodeVersions = JSON.parse(body) as INodeVersion[]; | ||
let response = await httpClient.getJson<INodeVersion[]>(dataUrl); | ||
let nodeVersions = response.result || []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|| []
is to satisfy typescript. Shouldnt be null since getJson checks for errors
Update README.md
also updated package.json scripts to align with setup-ruby, also ran npm audit fix