@@ -2,7 +2,7 @@ import { relative } from 'node:path';
22import { log , colorize } from '../utils/logger.ts' ;
33import { loadConfig } from '../core/config.ts' ;
44import { discoverWorkspace } from '../core/workspace.ts' ;
5- import { readBumpFiles } from '../core/bump-file.ts' ;
5+ import { readBumpFiles , filterBranchBumpFiles } from '../core/bump-file.ts' ;
66import { getChangedFiles } from '../core/git.ts' ;
77import type { WorkspacePackage } from '../types.ts' ;
88
@@ -14,17 +14,8 @@ import type { WorkspacePackage } from '../types.ts';
1414export async function checkCommand ( rootDir : string ) : Promise < void > {
1515 const config = await loadConfig ( rootDir ) ;
1616 const { packages } = await discoverWorkspace ( rootDir , config ) ;
17- const bumpFiles = await readBumpFiles ( rootDir ) ;
1817
19- // Find which packages already have bump files
20- const coveredPackages = new Set < string > ( ) ;
21- for ( const bf of bumpFiles ) {
22- for ( const release of bf . releases ) {
23- coveredPackages . add ( release . name ) ;
24- }
25- }
26-
27- // Find which packages have changed on this branch vs base
18+ // Find which files have changed on this branch vs base
2819 const baseBranch = config . baseBranch ;
2920 const changedFiles = getChangedFiles ( rootDir , baseBranch ) ;
3021
@@ -33,6 +24,25 @@ export async function checkCommand(rootDir: string): Promise<void> {
3324 return ;
3425 }
3526
27+ // Filter to only bump files added/modified on this branch
28+ const allBumpFiles = await readBumpFiles ( rootDir ) ;
29+ const { branchBumpFiles, branchBumpFileIds } = filterBranchBumpFiles ( allBumpFiles , changedFiles ) ;
30+
31+ // If a bump file was changed but didn't parse (empty bump file), the check passes
32+ const hasEmptyBumpFile = branchBumpFileIds . size > branchBumpFiles . length ;
33+ if ( hasEmptyBumpFile ) {
34+ log . success ( 'Empty bump file found — no releases needed.' ) ;
35+ return ;
36+ }
37+
38+ // Find which packages are covered by bump files on this branch
39+ const coveredPackages = new Set < string > ( ) ;
40+ for ( const bf of branchBumpFiles ) {
41+ for ( const release of bf . releases ) {
42+ coveredPackages . add ( release . name ) ;
43+ }
44+ }
45+
3646 const changedPackages = findChangedPackages ( changedFiles , packages , rootDir ) ;
3747
3848 if ( changedPackages . length === 0 ) {
0 commit comments