From ab89d30bb66a2a2f45db561231e94c7f486381f1 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Mon, 23 Jan 2023 11:31:43 +0100 Subject: [PATCH] chore: Suggest latest version when analyzing issue (#9564) Suggest using latest puppeteer rather then last supported version. --- tools/analyze_issue.mjs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/analyze_issue.mjs b/tools/analyze_issue.mjs index ce1af25f..d80a5441 100755 --- a/tools/analyze_issue.mjs +++ b/tools/analyze_issue.mjs @@ -7,10 +7,6 @@ import {writeFile, mkdir, copyFile} from 'fs/promises'; import {dirname, join} from 'path'; import semver from 'semver'; import {fileURLToPath} from 'url'; -import { - versionsPerRelease, - lastMaintainedChromiumVersion, -} from '../versions.js'; import core from '@actions/core'; import packageJson from '../packages/puppeteer/package.json' assert {type: 'json'}; @@ -28,10 +24,8 @@ const removeVersionPrefix = value => { return value.startsWith('v') ? value.slice(1) : value; }; -const LAST_SUPPORTED_PUPPETEER_VERSION = removeVersionPrefix( - versionsPerRelease.get(lastMaintainedChromiumVersion) ?? '' -); -if (!LAST_SUPPORTED_PUPPETEER_VERSION) { +const LAST_PUPPETEER_VERSION = packageJson.version; +if (!LAST_PUPPETEER_VERSION) { core.setFailed('No maintained version found.'); } const LAST_SUPPORTED_NODE_VERSION = removeVersionPrefix( @@ -73,7 +67,7 @@ This issue has an invalid Node.js version: \`${value}\`. Versions must follow [S }, unsupportedPuppeteerVersion(value) { return formatMessage(` -This issue has an unsupported Puppeteer version: \`${value}\`. Only versions above \`v${LAST_SUPPORTED_PUPPETEER_VERSION}\` are supported. Please verify the issue on a supported version of Puppeteer and update the form. +This issue has an outdated Puppeteer version: \`${value}\`. Please verify your issue on the latest \`${LAST_PUPPETEER_VERSION}\` version. Then update the form accordingly. `); }, invalidPuppeteerVersion(value) { @@ -226,8 +220,8 @@ This issue has an invalid Puppeteer version: \`${value}\`. Versions must follow core.setFailed(`Invalid puppeteer version: ${puppeteerVersion}`); } if ( - !LAST_SUPPORTED_PUPPETEER_VERSION || - semver.lt(puppeteerVersion, LAST_SUPPORTED_PUPPETEER_VERSION) + !LAST_PUPPETEER_VERSION || + semver.lt(puppeteerVersion, LAST_PUPPETEER_VERSION) ) { core.setOutput( 'errorMessage',