From d0395ed7be09da7710b68665ad27199092d17290 Mon Sep 17 00:00:00 2001 From: jvbriones <1674192+jvbriones@users.noreply.github.com> Date: Sat, 5 Dec 2026 19:12:15 +0100 Subject: [PATCH 1/2] chore: fix package version method --- .../scripts/post-merge-validation-tracker.mjs | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/scripts/post-merge-validation-tracker.mjs b/.github/scripts/post-merge-validation-tracker.mjs index c1a04317..072e4522 100644 --- a/.github/scripts/post-merge-validation-tracker.mjs +++ b/.github/scripts/post-merge-validation-tracker.mjs @@ -609,23 +609,20 @@ async function getCurrentPackageVersion(owner, repo) { } } -function parseVersionFromPatch(patch) { - const lines = patch.split('\n'); +function parseRootPackageVersionFromPatch(patch) { let oldVersion = null; let newVersion = null; - for (const line of lines) { - if (line.startsWith('-') && line.includes('"version":')) { - const match = line.match(/"version":\s*"([^"]+)"/u); - if (match) { - oldVersion = match[1]; - } + for (const line of patch.split('\n')) { + const match = line.match(/^([+-]) "version":\s*"([^"]+)"/u); + if (!match) { + continue; } - if (line.startsWith('+') && line.includes('"version":')) { - const match = line.match(/"version":\s*"([^"]+)"/u); - if (match) { - newVersion = match[1]; - } + + if (match[1] === '-') { + oldVersion = match[2]; + } else { + newVersion = match[2]; } } @@ -774,7 +771,9 @@ async function findVersionBumpCommits(owner, repo, sinceDateISO) { (file) => file.filename === 'package.json', ); if (packageJsonFile?.patch) { - const versionChange = parseVersionFromPatch(packageJsonFile.patch); + const versionChange = parseRootPackageVersionFromPatch( + packageJsonFile.patch, + ); if (versionChange) { return { sha: commit.sha, From 010cba4cde64c8c25835bb72793237daa98554be Mon Sep 17 00:00:00 2001 From: jvbriones <1674192+jvbriones@users.noreply.github.com> Date: Sat, 5 Dec 2026 19:24:12 +0100 Subject: [PATCH 2/2] chore: fix package version method --- .github/scripts/post-merge-validation-tracker.mjs | 2 +- vitest.config.mts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/post-merge-validation-tracker.mjs b/.github/scripts/post-merge-validation-tracker.mjs index 072e4522..7ac21b75 100644 --- a/.github/scripts/post-merge-validation-tracker.mjs +++ b/.github/scripts/post-merge-validation-tracker.mjs @@ -614,7 +614,7 @@ function parseRootPackageVersionFromPatch(patch) { let newVersion = null; for (const line of patch.split('\n')) { - const match = line.match(/^([+-]) "version":\s*"([^"]+)"/u); + const match = line.match(/^([+-]) {2}"version":\s*"([^"]+)"/u); if (!match) { continue; } diff --git a/vitest.config.mts b/vitest.config.mts index f27216e5..5222ad23 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -49,10 +49,10 @@ export default defineConfig({ thresholds: { // Raises the thresholds in this file when coverage improves. autoUpdate: true, - branches: 41.75, + branches: 41.9, functions: 50.79, - lines: 41.37, - statements: 41.56, + lines: 41.41, + statements: 41.59, }, }, },