Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/scripts/post-merge-validation-tracker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
Expand Down