chore: Suggest latest version when analyzing issue (#9564)
Suggest using latest puppeteer rather then last supported version.
This commit is contained in:
parent
9a97c5f8dd
commit
ab89d30bb6
@ -7,10 +7,6 @@ import {writeFile, mkdir, copyFile} from 'fs/promises';
|
|||||||
import {dirname, join} from 'path';
|
import {dirname, join} from 'path';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import {fileURLToPath} from 'url';
|
import {fileURLToPath} from 'url';
|
||||||
import {
|
|
||||||
versionsPerRelease,
|
|
||||||
lastMaintainedChromiumVersion,
|
|
||||||
} from '../versions.js';
|
|
||||||
import core from '@actions/core';
|
import core from '@actions/core';
|
||||||
import packageJson from '../packages/puppeteer/package.json' assert {type: 'json'};
|
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;
|
return value.startsWith('v') ? value.slice(1) : value;
|
||||||
};
|
};
|
||||||
|
|
||||||
const LAST_SUPPORTED_PUPPETEER_VERSION = removeVersionPrefix(
|
const LAST_PUPPETEER_VERSION = packageJson.version;
|
||||||
versionsPerRelease.get(lastMaintainedChromiumVersion) ?? ''
|
if (!LAST_PUPPETEER_VERSION) {
|
||||||
);
|
|
||||||
if (!LAST_SUPPORTED_PUPPETEER_VERSION) {
|
|
||||||
core.setFailed('No maintained version found.');
|
core.setFailed('No maintained version found.');
|
||||||
}
|
}
|
||||||
const LAST_SUPPORTED_NODE_VERSION = removeVersionPrefix(
|
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) {
|
unsupportedPuppeteerVersion(value) {
|
||||||
return formatMessage(`
|
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) {
|
invalidPuppeteerVersion(value) {
|
||||||
@ -226,8 +220,8 @@ This issue has an invalid Puppeteer version: \`${value}\`. Versions must follow
|
|||||||
core.setFailed(`Invalid puppeteer version: ${puppeteerVersion}`);
|
core.setFailed(`Invalid puppeteer version: ${puppeteerVersion}`);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!LAST_SUPPORTED_PUPPETEER_VERSION ||
|
!LAST_PUPPETEER_VERSION ||
|
||||||
semver.lt(puppeteerVersion, LAST_SUPPORTED_PUPPETEER_VERSION)
|
semver.lt(puppeteerVersion, LAST_PUPPETEER_VERSION)
|
||||||
) {
|
) {
|
||||||
core.setOutput(
|
core.setOutput(
|
||||||
'errorMessage',
|
'errorMessage',
|
||||||
|
Loading…
Reference in New Issue
Block a user