From 1618fa8528166a9e69ea6bfbbe7ca256ba8256ce Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Wed, 20 Mar 2024 15:22:16 +0100 Subject: [PATCH] chore: fix analyzer (#12112) --- tools/analyze_issue.mjs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/analyze_issue.mjs b/tools/analyze_issue.mjs index eff6a4122ed..62fd80452bb 100755 --- a/tools/analyze_issue.mjs +++ b/tools/analyze_issue.mjs @@ -36,9 +36,7 @@ const LAST_PUPPETEER_VERSION = packageJson.version; if (!LAST_PUPPETEER_VERSION) { core.setFailed('No maintained version found.'); } -const LAST_SUPPORTED_NODE_VERSION = removeVersionPrefix( - packageJson.engines.node.slice(2).trim() -); +const LAST_SUPPORTED_NODE_VERSION = packageJson.engines.node; const SUPPORTED_OSES = ['windows', 'macos', 'linux']; const SUPPORTED_PACKAGE_MANAGERS = ['yarn', 'npm', 'pnpm']; @@ -65,7 +63,7 @@ This issue has an invalid package manager version: \`${value}\`. Versions must f }, unsupportedNodeVersion(value) { return formatMessage(` -This issue has an unsupported Node.js version: \`${value}\`. Only versions above \`v${LAST_SUPPORTED_NODE_VERSION}\` are supported. Please verify the issue on a supported version of Node.js and update the form. +This issue has an unsupported Node.js version: \`${value}\`. Only versions satisfying \`${LAST_SUPPORTED_NODE_VERSION}\` are supported. Please verify the issue on a supported version of Node.js and update the form. `); }, invalidNodeVersion(value) { @@ -211,7 +209,7 @@ This issue has an invalid Puppeteer version: \`${value}\`. Versions must follow ); core.setFailed('Invalid Node version'); } - if (semver.lt(nodeVersion, LAST_SUPPORTED_NODE_VERSION)) { + if (!semver.satisfies(nodeVersion, LAST_SUPPORTED_NODE_VERSION)) { core.setOutput( 'errorMessage', ERROR_MESSAGES.unsupportedNodeVersion(nodeVersion)