ci: block .squad/.copilot files from merging into main (#116) #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Block AI team files on main | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| check-ai-files: | |
| name: No .squad / .copilot files on main | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fail if PR adds AI team files to main | |
| run: | | |
| # --diff-filter=AM: only Added or Modified — deletions (cleanup PRs) are allowed | |
| FILES=$(git diff --name-only --diff-filter=AM origin/main...HEAD \ | |
| | grep -E "^\.squad/|^\.copilot/|^\.github/agents/" || true) | |
| if [ -n "$FILES" ]; then | |
| echo "❌ This PR adds AI team files to main." | |
| echo " .squad/, .copilot/, and .github/agents/ belong on dev branches only." | |
| echo "" | |
| echo "Offending files:" | |
| echo "$FILES" | |
| exit 1 | |
| fi | |
| echo "✅ No AI team files detected in this PR." |