diff --git a/.github/scripts/post-merge-validation-tracker.mjs b/.github/scripts/post-merge-validation-tracker.mjs index c1a04317..7ac21b75 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(/^([+-]) {2}"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, 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, }, }, },