Use Node.js 16

This commit is contained in:
Giao Ho
2022-10-21 16:49:05 +07:00
parent a78c6028ba
commit e4ee2a05fa
4 changed files with 4651 additions and 995 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ outputs:
body:
description: The release body
runs:
using: node12
using: node16
main: action/index.js
branding:
icon: tag
+4629 -973
View File
File diff suppressed because one or more lines are too long
+17 -17
View File
@@ -29,27 +29,27 @@
"url": "https://github.com/joutvhu/get-release/issues"
},
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.4",
"@actions/github": "^4.0.0",
"@actions/http-client": "^1.0.11",
"tslib": "^2.1.0"
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1",
"@actions/http-client": "^2.0.1",
"tslib": "^2.4.0"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.1",
"@types/node": "^14.14.37",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@vercel/ncc": "^0.27.0",
"eslint": "^7.23.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.2",
"@types/node": "^16.11.68",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@vercel/ncc": "^0.34.0",
"eslint": "^8.25.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.1.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-promise": "^4.3.1",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.2.1",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"typescript": "^4.2.3"
"typescript": "^4.8.4"
}
}
+4 -4
View File
@@ -41,7 +41,7 @@ export function handlerError(message: string, throwing: boolean) {
else {
try {
// Get a release from the tag name
const releaseResponse = await github.repos
const releaseResponse = await github.rest.repos
.getReleaseByTag({
owner: inputs.owner,
repo: inputs.repo,
@@ -52,7 +52,7 @@ export function handlerError(message: string, throwing: boolean) {
setOutputs(releaseResponse.data, inputs.debug);
else
throw new Error(`Unexpected http ${releaseResponse.status} during get release`);
} catch (e) {
} catch (e: any) {
if (e.status === 404)
handlerError(`No release has been found with ${inputs.tag} tag`, inputs.throwing);
else
@@ -60,7 +60,7 @@ export function handlerError(message: string, throwing: boolean) {
}
}
} else {
const listResponse = await github.repos.listReleases({
const listResponse = await github.rest.repos.listReleases({
owner: inputs.owner,
repo: inputs.repo
});
@@ -87,7 +87,7 @@ export function handlerError(message: string, throwing: boolean) {
}
core.info('Get release has finished successfully');
} catch (err) {
} catch (err: any) {
core.setFailed(err.message);
}
})();