Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
marikaner committed Sep 13, 2024
1 parent bd37626 commit 7921555
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/actions/changesets-fixed-version-bump/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions build-packages/changesets-fixed-version-bump/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { readFile, writeFile } from 'node:fs/promises';
import { PathLike, readFileSync } from 'node:fs';
import { info } from 'node:console';
import getReleasePlan from '@changesets/get-release-plan';
import { inc } from 'semver';

Expand Down Expand Up @@ -32,12 +33,16 @@ export async function getNextVersion(): Promise<{
bumpType: (typeof bumpTypeOrder)[number];
}> {
const currentVersion = getPackageVersion();
info(`Current version: ${currentVersion}`);
const releasePlan = await getReleasePlan(process.cwd());

info(`Release plan: ${JSON.stringify(releasePlan)}`);

const versionIncreases = releasePlan.releases
.map(({ type }) => bumpTypeOrder.indexOf(type))
.sort((a, b) => b - a);
const bumpType = bumpTypeOrder[Math.min(...versionIncreases)];
info(`Bump type: ${bumpType}`);

if (bumpType === 'none' || !bumpType) {
throw new Error(`No changesets to release`);
Expand Down

0 comments on commit 7921555

Please sign in to comment.