Skip to content

Commit

Permalink
fix: clean up and organize logs
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Oct 9, 2024
1 parent 1b90386 commit 1c9142b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getLatestRelease, getNewVersion } from './utils.js';

async function run() {
try {
core.startGroup('Finding last tag...');
core.info('Finding last tag...');

// get the last tag
const octokit = github.getOctokit(core.getInput('repo-token'));
Expand Down Expand Up @@ -70,24 +70,28 @@ async function run() {

core.setOutput('current-version-number', currentVersion);

core.info(`latest release ${latestRelease ?? 'first release'}`);
core.endGroup();

// pass an object rather than a string to make sure that it gets included in the build
const bumper = new Bumper(process.cwd()).loadPreset('angular');
const recommendation = await bumper.bump();
core.info(`conventional release type ${recommendation.releaseType}`);

const prerelease = core.getBooleanInput('prerelease');

// these are helpful in diagnosing issues and adding new test cases
core.info(`latest tag: ${latestRelease ?? 'first release'}`);
core.info(`conventional release type ${recommendation.releaseType}`);
core.info(`prerelease: ${prerelease}`);
core.info(`latest prod release: ${latestProdRelease}`);

core.info(`current-version-number (output): ${currentVersion}`);

const newVersion = getNewVersion(
latestRelease,
recommendation.releaseType as string,
prerelease,
latestProdRelease as string,
);

core.info(`prerelease: ${prerelease}`);
core.info(`next version: ${newVersion}`);
core.info(`version (output): ${newVersion}`);

core.setOutput('version', newVersion);
if (newVersion) {
Expand Down

0 comments on commit 1c9142b

Please sign in to comment.