only trigger on major and minor version
This commit is contained in:
parent
439c192bfb
commit
0b484db04d
@ -35,13 +35,17 @@ if (typeof pkg.repository === 'undefined') {
|
||||
process.exit (1);
|
||||
}
|
||||
|
||||
function major (version) {
|
||||
return version.replace (/\\.[0-9]+$/ui, '');
|
||||
}
|
||||
|
||||
if (fs.existsSync ('README.md')) {
|
||||
const readme = fs.readFileSync ('README.md', 'utf-8');
|
||||
// eslint-disable-next-line prefer-named-capture-group
|
||||
const version = (/version: ([0-9.]+)/ui).exec (readme);
|
||||
if (
|
||||
version === null
|
||||
|| version[1] !== pkg.version
|
||||
|| major (version[1]) !== major (pkg.version)
|
||||
) {
|
||||
console.log ('readme version does not match package version');
|
||||
process.exit (1);
|
||||
|
@ -26,13 +26,17 @@ if (typeof pkg.repository === 'undefined') {
|
||||
process.exit (1);
|
||||
}
|
||||
|
||||
function major (version) {
|
||||
return version.replace (/\.[0-9]+$/ui, '');
|
||||
}
|
||||
|
||||
if (fs.existsSync ('README.md')) {
|
||||
const readme = fs.readFileSync ('README.md', 'utf-8');
|
||||
// eslint-disable-next-line prefer-named-capture-group
|
||||
const version = (/version: ([0-9.]+)/ui).exec (readme);
|
||||
if (
|
||||
version === null
|
||||
|| version[1] !== pkg.version
|
||||
|| major (version[1]) !== major (pkg.version)
|
||||
) {
|
||||
console.log ('readme version does not match package version');
|
||||
process.exit (1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user