Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/auto-label-prs-for-source-and-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
let touchesCloud = false;
let touchesOther = false;
let hasNewFile = false;
let hasDocContent = false;
let totalChanges = 0;

/**
Expand All @@ -97,7 +98,10 @@ jobs:
// Snippets live under docs/ and are shared — treat as CMS by convention
if (f.includes('/docs/snippets/') || f.startsWith('docs/snippets/')) return 'cms';

// Everything else (src/, scripts, config, .github/, agents/, etc.)
// Site source (components, SCSS, theme) — not infra, can be significant changes
if (f.includes('/src/') || f.startsWith('src/')) return 'static';

// Everything else (scripts, config, .github/, agents/, etc.)
return 'other';
}

Expand All @@ -108,9 +112,9 @@ jobs:
console.log(` → area: ${area}`);

switch (area) {
case 'cms': touchesCMS = true; break;
case 'cloud': touchesCloud = true; break;
case 'static': /* neutral — does not influence source */ break;
case 'cms': touchesCMS = true; hasDocContent = true; break;
case 'cloud': touchesCloud = true; hasDocContent = true; break;
case 'static': hasDocContent = true; break;
default: touchesOther = true; break;
}

Expand Down Expand Up @@ -142,17 +146,23 @@ jobs:

// -------------------------------------------------------
// 5. Determine PR type label
//
// Infrastructure-only PRs (.github/, agents/, scripts/,
// config files, etc.) are always "pr: chore",
// regardless of size. src/ is NOT infra (SCSS, components).
// -------------------------------------------------------
let prTypeLabel;
if (hasNewFile) {
if (!hasDocContent) {
prTypeLabel = 'pr: chore';
} else if (hasNewFile) {
prTypeLabel = 'pr: new content';
} else if (totalChanges > 10) {
prTypeLabel = 'pr: updated content';
} else {
prTypeLabel = 'pr: chore';
}

console.log(`Determined labels: ${sourceLabel}, ${prTypeLabel}`);
console.log(`Determined labels: ${sourceLabel}, ${prTypeLabel} (hasDocContent=${hasDocContent})`);

// -------------------------------------------------------
// 6. Apply labels (skip categories that already have one)
Expand Down
Loading