@@ -3,11 +3,16 @@ import { listWorkspaces } from '../list-workspaces/list-workspaces.mjs';
33import path from 'path' ;
44
55const internalDependencies = [
6- '.github' + path . sep ,
7- 'package-lock.json' ,
8- 'package.json' ,
9- 'rollup' + path . sep ,
10- 'tsconfig.json' ,
6+ path . relative ( process . cwd ( ) , path . resolve ( '.github' ) ) ,
7+ path . relative ( process . cwd ( ) , path . resolve ( 'package-lock.json' ) ) ,
8+ path . relative ( process . cwd ( ) , path . resolve ( 'package.json' ) ) ,
9+ path . relative ( process . cwd ( ) , path . resolve ( 'rollup' ) ) ,
10+ path . relative ( process . cwd ( ) , path . resolve ( 'tsconfig.json' ) ) ,
11+ ] ;
12+
13+ const knownNotRelevant = [
14+ path . relative ( process . cwd ( ) , path . resolve ( 'e2e' ) ) ,
15+ path . relative ( process . cwd ( ) , path . resolve ( 'sites' ) ) ,
1116] ;
1217
1318export async function listModifiedWorkspaces ( ) {
@@ -44,15 +49,14 @@ export async function listModifiedWorkspaces() {
4449
4550 const modifiedWorkspaces = new Set ( ) ;
4651
52+ MODIFIED_FILED_LOOP:
4753 for ( const modifiedFile of modifiedFiles ) {
4854 const modifiedFilePath = path . relative ( process . cwd ( ) , path . format ( path . posix . parse ( modifiedFile ) ) ) ;
4955
50- if ( modifiedFile . startsWith ( 'e2e' + path . sep ) ) {
51- continue ;
52- }
53-
54- if ( modifiedFile . startsWith ( 'sites' + path . sep ) ) {
55- continue ;
56+ for ( const notRelevant of knownNotRelevant ) {
57+ if ( modifiedFile . startsWith ( notRelevant ) ) {
58+ continue MODIFIED_FILED_LOOP;
59+ }
5660 }
5761
5862 for ( const internalDependency of internalDependencies ) {
0 commit comments