chore: add check pub command is running on main branch

This commit is contained in:
Andrei O 2025-01-23 11:51:31 +02:00
parent bada249262
commit 60ae1fb2a1
No known key found for this signature in database
GPG Key ID: B961E5B68389457E

View File

@ -3,6 +3,14 @@ import { readFileSync, writeFileSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';
async function main() { async function main() {
// -1. Check if you are in the main branch
const branch = execSync(`git branch --show-current`).toString();
if (branch !== 'main') {
console.log('You must be in the main branch to create a release');
return
}
// 0. Check tag is not already created // 0. Check tag is not already created
const tags = execSync(`git tag --list`).toString(); const tags = execSync(`git tag --list`).toString();
if(!process.env.npm_package_version) { if(!process.env.npm_package_version) {