File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Enforce Repository Structure
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+
7+ jobs :
8+ structure-check :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+
15+ - name : Check modified paths
16+ run : |
17+ echo "Checking modified files..."
18+
19+ git fetch origin main
20+ CHANGED_FILES=$(git diff --name-only origin/main...HEAD)
21+
22+ echo "Changed files:"
23+ echo "$CHANGED_FILES"
24+
25+ INVALID_PATHS=$(echo "$CHANGED_FILES" | grep -Ev \
26+ '^(level-[0-9]+-|challenges/|resources/|roadmap/|\.github/|README.md|CONTRIBUTING.md|CODE_OF_CONDUCT.md|LICENSE)')
27+
28+ if [ -n "$INVALID_PATHS" ]; then
29+ echo "❌ Invalid paths detected:"
30+ echo "$INVALID_PATHS"
31+ echo ""
32+ echo "Contributions must follow the level-based structure."
33+ exit 1
34+ fi
35+
36+ echo "✅ Structure check passed."
You can’t perform that action at this time.
0 commit comments