From 1d4c05ef61e0473d2146183bbce129fda5cd681e Mon Sep 17 00:00:00 2001 From: Marika Marszalkowski Date: Thu, 12 Sep 2024 16:42:46 +0200 Subject: [PATCH] fix bump type --- .github/actions/changesets-fixed-version-bump/index.js | 4 ++-- build-packages/changesets-fixed-version-bump/util.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/changesets-fixed-version-bump/index.js b/.github/actions/changesets-fixed-version-bump/index.js index 6fad60add9..f7e946c145 100644 --- a/.github/actions/changesets-fixed-version-bump/index.js +++ b/.github/actions/changesets-fixed-version-bump/index.js @@ -36,12 +36,12 @@ async function getNextVersion() { .map(({ type }) => bumpTypeOrder.indexOf(type)) .sort((a, b) => b - a); const bumpType = bumpTypeOrder[Math.min(...versionIncreases)]; - if (bumpType === 'none') { + if (bumpType === 'none' || !bumpType) { throw new Error(`No changesets to release`); } const version = (0, semver_1.inc)(currentVersion, bumpType); if (!version) { - throw new Error(`Invalid new version -- current version: ${currentVersion}, version type: ${bumpType}`); + throw new Error(`Invalid new version -- current version: ${currentVersion}, bump type: ${bumpType}`); } return { version, bumpType }; } diff --git a/build-packages/changesets-fixed-version-bump/util.ts b/build-packages/changesets-fixed-version-bump/util.ts index 84b25a9fb1..05074cd51e 100644 --- a/build-packages/changesets-fixed-version-bump/util.ts +++ b/build-packages/changesets-fixed-version-bump/util.ts @@ -39,14 +39,14 @@ export async function getNextVersion(): Promise<{ .sort((a, b) => b - a); const bumpType = bumpTypeOrder[Math.min(...versionIncreases)]; - if (bumpType === 'none') { + if (bumpType === 'none' || !bumpType) { throw new Error(`No changesets to release`); } const version = inc(currentVersion, bumpType); if (!version) { throw new Error( - `Invalid new version -- current version: ${currentVersion}, version type: ${bumpType}` + `Invalid new version -- current version: ${currentVersion}, bump type: ${bumpType}` ); } return { version, bumpType };