Skip to content

Commit af4d7fe

Browse files
authored
Merge pull request #117 from fboucher/fix/block-squad-on-main
ci: block .squad/.copilot files from merging into main (#116)
2 parents 1bebfbc + beb1b2c commit af4d7fe

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Block AI team files on main
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check-ai-files:
10+
name: No .squad / .copilot files on main
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Fail if PR adds AI team files to main
18+
run: |
19+
# --diff-filter=AM: only Added or Modified — deletions (cleanup PRs) are allowed
20+
FILES=$(git diff --name-only --diff-filter=AM origin/main...HEAD \
21+
| grep -E "^\.squad/|^\.copilot/|^\.github/agents/" || true)
22+
23+
if [ -n "$FILES" ]; then
24+
echo "❌ This PR adds AI team files to main."
25+
echo " .squad/, .copilot/, and .github/agents/ belong on dev branches only."
26+
echo ""
27+
echo "Offending files:"
28+
echo "$FILES"
29+
exit 1
30+
fi
31+
32+
echo "✅ No AI team files detected in this PR."

0 commit comments

Comments
 (0)