chore: my bad boo

This commit is contained in:
Vlad Frangu
2024-03-04 21:45:48 +02:00
parent 2814d7e2f5
commit d98c991c35

View File

@@ -1,12 +1,15 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access */
import { execSync } from 'node:child_process';
import process from 'node:process';
import { promisify } from 'node:util';
import { Octokit } from '@octokit/action';
import conventionalRecommendedBump from 'conventional-recommended-bump';
console.log('🚀 Running the release script...');
const lastCommitMessage = execSync('git log -1 --pretty=%B', { encoding: 'utf8' });
console.log(` Last commit message: ${lastCommitMessage}`);
if (lastCommitMessage.startsWith('chore(release)')) {
console.log('Preventing the action from completing as there are no new commits to release.');
process.exit(1);
@@ -18,11 +21,14 @@ const conventionalReleaseTypesTo0Ver = new Map([
['patch', 'patch'],
]);
const asyncConventionalRecommendBump = promisify(conventionalRecommendedBump);
console.log(' Getting the recommended bump level...');
const result = await asyncConventionalRecommendBump({ preset: 'angular' }, undefined);
const result = await conventionalRecommendedBump({ preset: 'angular' });
console.log(' Got the recommended bump level:', result);
if (!result.releaseType) {
console.log('help');
throw new Error('No recommended bump level found');
}