diff --git a/.github/supporting-files/ci/build-partitioning/build_partitioning.ts b/.github/supporting-files/ci/build-partitioning/build_partitioning.ts index a9dcd6f77a5..8b080b25185 100644 --- a/.github/supporting-files/ci/build-partitioning/build_partitioning.ts +++ b/.github/supporting-files/ci/build-partitioning/build_partitioning.ts @@ -182,7 +182,7 @@ async function getPartitions(): Promise> { const chunkSize = 50; for (let i = 0; i < changedPackagesNames.length; i += chunkSize) { changedPackagesNamesChunks.push( - changedPackagesNames.slice(i, Math.min(i + chunkSize, changedPackagesNames.length - 1)) + changedPackagesNames.slice(i, Math.min(i + chunkSize, changedPackagesNames.length)) ); } @@ -215,7 +215,7 @@ async function getPartitions(): Promise> { } const changedSourcePathsInPartition = changedPackagesDirs.filter((path) => - [...partition.dirs].some((partitionDir) => path.startsWith(`${partitionDir}`)) + [...partition.dirs].some((partitionDir) => path === partitionDir) ); if (changedSourcePathsInPartition.length === 0) { @@ -268,6 +268,9 @@ async function getPartitions(): Promise> { } async function getDirsOfDependencies(leafPackageNames: Set) { + if (leafPackageNames.size === 0) { + return new Set(); + } const packagesFilter = [...leafPackageNames].map((pkgName) => `-F ${pkgName}...`).join(" "); return new Set( stdoutArray(execSync(`bash -c "pnpm ${packagesFilter} exec bash -c pwd"`).toString()) //