From 414f093a36addf22f98c0b9eb0e32b0c3dda0081 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Thu, 1 May 2025 12:05:25 +0000 Subject: [PATCH] Update to Node.js 20 compatibility --- .github/workflows/test.yml | 8 ++++---- action.yml | 2 +- package-lock.json | 41 +++++++++++++++++++++++++++++--------- package.json | 5 ++++- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2dca0e5..1a88146 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: build: # make sure build/ci work properly strategy: matrix: - node: [18] + node: [20] os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: @@ -27,7 +27,7 @@ jobs: build-on-windows: strategy: matrix: - node: [18] + node: [20] runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -45,7 +45,7 @@ jobs: test: # make sure the action works on a clean machine without building strategy: matrix: - node: [18] + node: [20] os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: @@ -73,7 +73,7 @@ jobs: test-on-windows: strategy: matrix: - node: [18] + node: [20] runs-on: windows-latest steps: - name: Dump GitHub context diff --git a/action.yml b/action.yml index 906f71c..8b14c5e 100644 --- a/action.yml +++ b/action.yml @@ -50,7 +50,7 @@ outputs: npm_audit: description: 'The output of the npm audit report in a text format' runs: - using: 'node16' + using: 'node20' main: 'dist/index.js' branding: icon: 'search' diff --git a/package-lock.json b/package-lock.json index db6e1c4..5295c1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@types/jest": "^29.5.5", - "@types/node": "^18.0.0", + "@types/node": "^20.0.0", "@typescript-eslint/parser": "^6.7.4", "@vercel/ncc": "^0.38.0", "eslint": "^8.51.0", @@ -29,6 +29,9 @@ "prettier": "^3.0.3", "ts-jest": "^29.1.1", "typescript": "^5.2.2" + }, + "engines": { + "node": ">=20.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1766,10 +1769,14 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.13.tgz", - "integrity": "sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w==", - "dev": true + "version": "20.17.32", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.32.tgz", + "integrity": "sha512-zeMXFn8zQ+UkjK4ws0RiOC9EWByyW1CcVmLe+2rQocXRsGEDxUCwPEIVgpsGcLHS/P8JkT0oa3839BRABS0oPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } }, "node_modules/@types/semver": { "version": "7.5.3", @@ -7081,6 +7088,13 @@ "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": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -8710,10 +8724,13 @@ "dev": true }, "@types/node": { - "version": "18.11.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.13.tgz", - "integrity": "sha512-IASpMGVcWpUsx5xBOrxMj7Bl8lqfuTY7FKAnPmu5cHkfQVWF8GulWS1jbRqA934qZL35xh5xN/+Xe/i26Bod4w==", - "dev": true + "version": "20.17.32", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.32.tgz", + "integrity": "sha512-zeMXFn8zQ+UkjK4ws0RiOC9EWByyW1CcVmLe+2rQocXRsGEDxUCwPEIVgpsGcLHS/P8JkT0oa3839BRABS0oPw==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } }, "@types/semver": { "version": "7.5.3", @@ -12478,6 +12495,12 @@ "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": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", diff --git a/package.json b/package.json index 3a3a82e..18703d1 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "private": true, "description": "GitHub Action to run `npm audit`", "main": "lib/main.js", + "engines": { + "node": ">=20.0.0" + }, "scripts": { "build": "tsc", "format": "prettier --write **/*.ts", @@ -33,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.5", - "@types/node": "^18.0.0", + "@types/node": "^20.0.0", "@typescript-eslint/parser": "^6.7.4", "@vercel/ncc": "^0.38.0", "eslint": "^8.51.0",