File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,19 +58,27 @@ async function main() {
5858
5959 const unreleasedWorkspaces : Workspace [ ] = [ ] ;
6060
61- for ( const versionFile of versionFiles ) {
62- for ( const workspace of versionFile . changedWorkspaces ) {
63- if ( ! workspace . manifest . version ) continue ;
64- if ( versionFile ?. releases . has ( workspace ) ) continue ;
65- const diff = execSync (
66- `git diff origin/main -- ${ join ( workspace . relativeCwd , "package.json" ) } ` ,
67- {
68- encoding : "utf-8" ,
69- } ,
70- ) ;
71- const hasBeenUpgraded = / ^ \+ \s * " v e r s i o n " : / gm. test ( diff ) ;
72- if ( ! hasBeenUpgraded ) unreleasedWorkspaces . push ( workspace ) ;
61+ if ( versionFiles . length ) {
62+ for ( const versionFile of versionFiles ) {
63+ for ( const workspace of versionFile . changedWorkspaces ) {
64+ if ( ! workspace . manifest . version ) continue ;
65+ if ( versionFile ?. releases . has ( workspace ) ) continue ;
66+ const diff = execSync (
67+ `git diff origin/main -- ${ join ( workspace . relativeCwd , "package.json" ) } ` ,
68+ {
69+ encoding : "utf-8" ,
70+ } ,
71+ ) ;
72+ const hasBeenUpgraded = / ^ \+ \s * " v e r s i o n " : / gm. test ( diff ) ;
73+ if ( ! hasBeenUpgraded ) unreleasedWorkspaces . push ( workspace ) ;
74+ }
7375 }
76+ } else {
77+ const changedWorkspaces = await gitUtils . fetchChangedWorkspaces ( {
78+ ref : "origin/main" ,
79+ project,
80+ } ) ;
81+ unreleasedWorkspaces . push ( ...Array . from ( changedWorkspaces ) . filter ( ( w ) => w . manifest . version ) ) ;
7482 }
7583
7684 if ( unreleasedWorkspaces . length ) {
You can’t perform that action at this time.
0 commit comments