Update to Node.js 20 compatibility

This commit is contained in:
Naoki Oketani
2025-05-01 12:05:25 +00:00
parent 362afbddca
commit 414f093a36
4 changed files with 41 additions and 15 deletions

View File

@@ -9,7 +9,7 @@ jobs:
build: # make sure build/ci work properly build: # make sure build/ci work properly
strategy: strategy:
matrix: matrix:
node: [18] node: [20]
os: [ ubuntu-latest, macos-latest ] os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@@ -27,7 +27,7 @@ jobs:
build-on-windows: build-on-windows:
strategy: strategy:
matrix: matrix:
node: [18] node: [20]
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -45,7 +45,7 @@ jobs:
test: # make sure the action works on a clean machine without building test: # make sure the action works on a clean machine without building
strategy: strategy:
matrix: matrix:
node: [18] node: [20]
os: [ ubuntu-latest, macos-latest ] os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@@ -73,7 +73,7 @@ jobs:
test-on-windows: test-on-windows:
strategy: strategy:
matrix: matrix:
node: [18] node: [20]
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Dump GitHub context - name: Dump GitHub context

View File

@@ -50,7 +50,7 @@ outputs:
npm_audit: npm_audit:
description: 'The output of the npm audit report in a text format' description: 'The output of the npm audit report in a text format'
runs: runs:
using: 'node16' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'
branding: branding:
icon: 'search' icon: 'search'

41
package-lock.json generated
View File

@@ -16,7 +16,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.5", "@types/jest": "^29.5.5",
"@types/node": "^18.0.0", "@types/node": "^20.0.0",
"@typescript-eslint/parser": "^6.7.4", "@typescript-eslint/parser": "^6.7.4",
"@vercel/ncc": "^0.38.0", "@vercel/ncc": "^0.38.0",
"eslint": "^8.51.0", "eslint": "^8.51.0",
@@ -29,6 +29,9 @@
"prettier": "^3.0.3", "prettier": "^3.0.3",
"ts-jest": "^29.1.1", "ts-jest": "^29.1.1",
"typescript": "^5.2.2" "typescript": "^5.2.2"
},
"engines": {
"node": ">=20.0.0"
} }
}, },
"node_modules/@aashutoshrathi/word-wrap": { "node_modules/@aashutoshrathi/word-wrap": {
@@ -1766,10 +1769,14 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.11.13", "version": "20.17.32",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.13.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.32.tgz",
"integrity": "sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w==", "integrity": "sha512-zeMXFn8zQ+UkjK4ws0RiOC9EWByyW1CcVmLe+2rQocXRsGEDxUCwPEIVgpsGcLHS/P8JkT0oa3839BRABS0oPw==",
"dev": true "dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.19.2"
}
}, },
"node_modules/@types/semver": { "node_modules/@types/semver": {
"version": "7.5.3", "version": "7.5.3",
@@ -7081,6 +7088,13 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/undici-types": {
"version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
"dev": true,
"license": "MIT"
},
"node_modules/universal-user-agent": { "node_modules/universal-user-agent": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
@@ -8710,10 +8724,13 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "18.11.13", "version": "20.17.32",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.13.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.32.tgz",
"integrity": "sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w==", "integrity": "sha512-zeMXFn8zQ+UkjK4ws0RiOC9EWByyW1CcVmLe+2rQocXRsGEDxUCwPEIVgpsGcLHS/P8JkT0oa3839BRABS0oPw==",
"dev": true "dev": true,
"requires": {
"undici-types": "~6.19.2"
}
}, },
"@types/semver": { "@types/semver": {
"version": "7.5.3", "version": "7.5.3",
@@ -12478,6 +12495,12 @@
"which-boxed-primitive": "^1.0.2" "which-boxed-primitive": "^1.0.2"
} }
}, },
"undici-types": {
"version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
"dev": true
},
"universal-user-agent": { "universal-user-agent": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",

View File

@@ -4,6 +4,9 @@
"private": true, "private": true,
"description": "GitHub Action to run `npm audit`", "description": "GitHub Action to run `npm audit`",
"main": "lib/main.js", "main": "lib/main.js",
"engines": {
"node": ">=20.0.0"
},
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"format": "prettier --write **/*.ts", "format": "prettier --write **/*.ts",
@@ -33,7 +36,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.5", "@types/jest": "^29.5.5",
"@types/node": "^18.0.0", "@types/node": "^20.0.0",
"@typescript-eslint/parser": "^6.7.4", "@typescript-eslint/parser": "^6.7.4",
"@vercel/ncc": "^0.38.0", "@vercel/ncc": "^0.38.0",
"eslint": "^8.51.0", "eslint": "^8.51.0",