Fix release post not parsing certain versions correctly (#35363)

This commit is contained in:
Roy Ho 2022-10-28 05:42:46 -07:00 committed by GitHub
parent a18f1bde92
commit f10f740958
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -51,7 +51,14 @@ const program = new Command()
if ( ! options.previousVersion && previousVersion ) {
// e.g 6.8.0 -> 6.7.0
previousVersion.minor -= 1;
previousVersion.major =
previousVersion.minor === 0
? previousVersion.major - 1
: previousVersion.major;
previousVersion.minor =
previousVersion.minor === 0 ? 9 : previousVersion.minor - 1;
previousVersion.format();
}