diff options
Diffstat (limited to 'remote/test/puppeteer/tools/analyze_issue.mjs')
-rwxr-xr-x | remote/test/puppeteer/tools/analyze_issue.mjs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/remote/test/puppeteer/tools/analyze_issue.mjs b/remote/test/puppeteer/tools/analyze_issue.mjs index eff6a4122e..359ce93b87 100755 --- a/remote/test/puppeteer/tools/analyze_issue.mjs +++ b/remote/test/puppeteer/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) { @@ -109,8 +107,8 @@ This issue has an invalid Puppeteer version: \`${value}\`. Versions must follow let set = () => { return void 0; }; - let j = 1; - let i = 1; + let j = 0; + let i = 0; for (; i < lines.length; ++i) { if (lines[i].startsWith('### Bug behavior')) { set(lines.slice(j, i).join('\n').trim()); @@ -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) |