diff --git a/actions/setup/js/memory_custom_validation.cjs b/actions/setup/js/memory_custom_validation.cjs index a92f4cc67fc..58099ac7fe2 100644 --- a/actions/setup/js/memory_custom_validation.cjs +++ b/actions/setup/js/memory_custom_validation.cjs @@ -45,12 +45,12 @@ function readDirectory(targetPath) { /** * @param {string} targetPath - * @param {BufferEncoding | undefined} [encoding] + * @param {BufferEncoding} [encoding] * @returns {any} */ function readFile(targetPath, encoding) { try { - return fs.readFileSync(targetPath, encoding); + return encoding ? fs.readFileSync(targetPath, encoding) : fs.readFileSync(targetPath); } catch (error) { throw new Error(`Failed to read ${targetPath}: ${getErrorMessage(error)}`, { cause: error }); } diff --git a/actions/setup/js/package-lock.json b/actions/setup/js/package-lock.json index 53fe92f7cbb..f2cf2dff641 100644 --- a/actions/setup/js/package-lock.json +++ b/actions/setup/js/package-lock.json @@ -13,7 +13,7 @@ "@actions/glob": "^0.7.0", "@actions/io": "^3.0.2", "@github/copilot-sdk": "^1.0.11", - "@types/node": "^26.2.0", + "@types/node": "^26.4.0", "@vitest/coverage-v8": "^4.1.11", "@vitest/ui": "^4.1.10", "minimatch": ">=10.2.6", @@ -1587,9 +1587,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.2.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz", - "integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==", + "version": "26.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.0.tgz", + "integrity": "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/actions/setup/js/package.json b/actions/setup/js/package.json index 6f563dcf801..6995e7ec467 100644 --- a/actions/setup/js/package.json +++ b/actions/setup/js/package.json @@ -8,7 +8,7 @@ "@actions/glob": "^0.7.0", "@actions/io": "^3.0.2", "@github/copilot-sdk": "^1.0.11", - "@types/node": "^26.2.0", + "@types/node": "^26.4.0", "@vitest/coverage-v8": "^4.1.11", "@vitest/ui": "^4.1.10", "minimatch": ">=10.2.6",