Skip to content

Commit 50e42d7

Browse files
committed
fix
1 parent c197017 commit 50e42d7

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/bin/modified-workspaces/modified-workspaces.mjs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ import { listWorkspaces } from '../list-workspaces/list-workspaces.mjs';
33
import path from 'path';
44

55
const 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

1318
export 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

Comments
 (0)