diff --git a/src/utils/commits.ts b/src/utils/commits.ts index 15bb312..48fdee2 100644 --- a/src/utils/commits.ts +++ b/src/utils/commits.ts @@ -75,7 +75,7 @@ export async function getCommits({ // add to the list commits[position].push(commit.hash); } - positions.push(position); + positions.unshift(position); } else { const initMatches = commit.message.match(/^INIT/); if (initMatches && initMatches.length) { @@ -86,7 +86,7 @@ export async function getCommits({ // add to the list commits.INIT.push(commit.hash); } - positions.push("INIT"); + positions.unshift("INIT"); } } } diff --git a/src/utils/validateCommits.ts b/src/utils/validateCommits.ts index 9535968..80d714d 100644 --- a/src/utils/validateCommits.ts +++ b/src/utils/validateCommits.ts @@ -13,8 +13,8 @@ export function validateCommitOrder(positions: string[]): boolean { current = { level: 0, step: 0 }; return; } else { - const levelMatch = position.match(/^L([0-9])+$/); - const stepMatch = position.match(/^L([0-9])+S([0-9])+$/); + const levelMatch = position.match(/^L([0-9]+)Q?$/); + const stepMatch = position.match(/^L([0-9]+)S([0-9]+)[Q|A]?$/); if (levelMatch) { // allows next level or step const [_, levelString] = levelMatch; @@ -28,7 +28,7 @@ export function validateCommitOrder(positions: string[]): boolean { current = { level, step }; } else { // error - console.error(`Invalid commit position: ${position}`); + console.warn(`Invalid commit position: ${position}`); return; } if (