Skip to content

Commit c8de0e5

Browse files
committed
Ignore static/ folder (images) when auto-detecting source: for PRs
1 parent a32419f commit c8de0e5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/auto-label-prs-for-source-and-content.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,21 @@ jobs:
5959
let hasNewFile = false;
6060
let totalChanges = 0;
6161
62+
const imageExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp'];
63+
6264
for (const file of files) {
6365
console.log(`File: ${file.filename}, status: ${file.status}, +${file.additions} -${file.deletions}`);
6466
65-
if (file.filename.startsWith('cms/')) {
66-
touchesCMS = true;
67-
} else if (file.filename.startsWith('cloud/')) {
68-
touchesCloud = true;
69-
} else {
70-
touchesOther = true;
67+
const isImage = imageExtensions.some(ext => file.filename.toLowerCase().endsWith(ext));
68+
69+
if (!isImage) {
70+
if (file.filename.startsWith('cms/')) {
71+
touchesCMS = true;
72+
} else if (file.filename.startsWith('cloud/')) {
73+
touchesCloud = true;
74+
} else {
75+
touchesOther = true;
76+
}
7177
}
7278
7379
if (file.status === 'added') {

0 commit comments

Comments
 (0)