Skip to content

Fix changeset checker logic #4411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2021
Merged
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
5 changes: 3 additions & 2 deletions scripts/check_changeset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function getHighestBump(changesetPackages: Record<string, string>) {
let highestBump = bumpRank.patch;
let highestBumpText = 'patch';
let bumpPackage = '';
for (const pkgName of Object.keys(changesetPackages)) {
for (const pkgName of Object.keys(changesetPackages)) {
if (
pkgName !== 'firebase' &&
bumpRank[changesetPackages[pkgName]] > highestBump
Expand Down Expand Up @@ -177,13 +177,14 @@ async function main() {
`- Package ${bumpPackage} has a ${bumpText} bump which requires an ` +
`additional line to bump the main "firebase" package to ${bumpText}.`
);
console.log(`::set-output name=BLOCKING_FAILURE::true`);
} else if (bumpRank[changesetPackages['firebase']] < highestBump) {
errors.push(
`- Package ${bumpPackage} has a ${bumpText} bump. ` +
`Increase the bump for the main "firebase" package to ${bumpText}.`
);
console.log(`::set-output name=BLOCKING_FAILURE::true`);
}
console.log(`::set-output name=BLOCKING_FAILURE::true`);
}
}
} catch (e) {
Expand Down