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
24 changes: 12 additions & 12 deletions .github/workflows/squad-main-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,36 +69,36 @@ jobs:
}

// Check each file against forbidden path rules
// Allow removals ΓÇö deleting forbidden files from protected branches is fine
// Allow removals - deleting forbidden files from protected branches is fine
const forbidden = files
.filter(f => f.status !== 'removed')
.map(f => f.filename)
.filter(f => {
// .ai-team/** and .squad/** ΓÇö ALL team state files, zero exceptions
// .ai-team/** and .squad/** - ALL team state files, zero exceptions
if (f === '.ai-team' || f.startsWith('.ai-team/') || f === '.squad' || f.startsWith('.squad/')) return true;
// .ai-team-templates/** ΓÇö Squad's own templates, stay on dev
// .ai-team-templates/** - Squad's own templates, stay on dev
if (f === '.ai-team-templates' || f.startsWith('.ai-team-templates/')) return true;
// team-docs/** ΓÇö ALL internal team docs, zero exceptions
// team-docs/** - ALL internal team docs, zero exceptions
if (f.startsWith('team-docs/')) return true;
// docs/proposals/** ΓÇö internal design proposals, stay on dev
// docs/proposals/** - internal design proposals, stay on dev
if (f.startsWith('docs/proposals/')) return true;
return false;
});

if (forbidden.length === 0) {
core.info('✅ No forbidden paths found in PR — all clear.');
core.info('[OK] No forbidden paths found in PR - all clear.');
return;
}

// Build a clear, actionable error message
const lines = [
'## 🚫 Forbidden files detected in PR to main',
'## [WARNING] Forbidden files detected in PR to main',
'',
'The following files must NOT be merged into `main`.',
'`.ai-team/` and `.squad/` are runtime team state ΓÇö they belong on dev branches only.',
'`.ai-team-templates/` is Squad\'s internal planning ΓÇö it belongs on dev branches only.',
'`team-docs/` is internal team content ΓÇö it belongs on dev branches only.',
'`docs/proposals/` is internal design proposals ΓÇö it belongs on dev branches only.',
'`.ai-team/` and `.squad/` are runtime team state - they belong on dev branches only.',
'`.ai-team-templates/` is Squad\'s internal planning - it belongs on dev branches only.',
'`team-docs/` is internal team content - it belongs on dev branches only.',
'`docs/proposals/` is internal design proposals - it belongs on dev branches only.',
'',
'### Forbidden files found:',
'',
Expand All @@ -121,7 +121,7 @@ jobs:
'git push',
'```',
'',
'> ⚠️ `.ai-team/` and `.squad/` are committed on `dev` and feature branches by design.',
'> [NOTE] `.ai-team/` and `.squad/` are committed on `dev` and feature branches by design.',
'> The guard workflow is the enforcement mechanism that keeps these files off `main` and `preview`.',
'> `git rm --cached` untracks them from this PR without deleting your local copies.',
];
Expand Down
Loading