Enable to release update for previous major

This commit is contained in:
garronej 2022-09-09 14:32:05 +02:00
parent 6a267b716c
commit 1b498f1789
4 changed files with 60 additions and 21 deletions

View file

@ -12,13 +12,14 @@ export function getLatestSemVersionedTagFactory(params: { octokit: Octokit; }) {
owner: string;
repo: string;
beta: "ONLY LOOK FOR BETA" | "IGNORE BETA" | "BETA OR REGULAR RELEASE";
major: number | undefined;
}
): Promise<{
tag: string;
version: NpmModuleVersion;
} | undefined> {
const { owner, repo, beta } = params;
const { owner, repo, beta, major } = params;
const semVersionedTags: { tag: string; version: NpmModuleVersion; }[] = [];
@ -32,6 +33,10 @@ export function getLatestSemVersionedTagFactory(params: { octokit: Octokit; }) {
version = NpmModuleVersion.parse(tag.replace(/^[vV]?/, ""));
if (major !== undefined && version.major !== major) {
continue;
}
} catch {
continue;
}