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
88 changes: 88 additions & 0 deletions .github/workflows/validate-repo-structure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Validate Repository Structure

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
validate-structure:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Validate required directories
run: |
echo "Checking for required directories..."
required_dirs=("model" "docs" "scripts" "data" "screenshots")

for dir in "${required_dirs[@]}"; do
if [ ! -d "$dir" ]; then
echo "❌ ERROR: Required directory missing: $dir"
exit 1
else
echo "✅ Found directory: $dir"
fi
done
Comment on lines +21 to +29

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow will currently fail on every push/PR because it enforces directories (model/docs/scripts/data/screenshots) that do not exist in the repository. Either add these directories in the same PR (e.g., with placeholder files) or relax/gate the check (e.g., only warn or run on workflow_dispatch until the structure is in place).

Suggested change
for dir in "${required_dirs[@]}"; do
if [ ! -d "$dir" ]; then
echo "❌ ERROR: Required directory missing: $dir"
exit 1
else
echo "✅ Found directory: $dir"
fi
done
missing_dirs=()
for dir in "${required_dirs[@]}"; do
if [ ! -d "$dir" ]; then
echo "⚠️ WARNING: Required directory missing: $dir"
missing_dirs+=("$dir")
else
echo "✅ Found directory: $dir"
fi
done
if [ "${#missing_dirs[@]}" -eq 0 ]; then
echo "✅ All required directories are present."
else
echo "⚠️ Some required directories are missing:"
for missing in "${missing_dirs[@]}"; do
echo " - $missing"
done
echo "⚠️ Repository structure check is currently informational only; please add the missing directories in a future change."
fi

Copilot uses AI. Check for mistakes.

- name: Validate required documentation files
run: |
echo "Checking for required documentation files..."
required_files=("README.md" "LICENSE" "CONTRIBUTING.md" "docs/METHODOLOGY.md" "docs/ASSUMPTIONS.md")

for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
echo "❌ ERROR: Required file missing: $file"
exit 1
else
echo "✅ Found file: $file"
fi
done
Comment on lines +33 to +43

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step requires CONTRIBUTING.md and docs/METHODOLOGY.md + docs/ASSUMPTIONS.md, but those files (and the docs/ directory) are not present in the repo right now, so the workflow will fail. Either include the missing files in this PR or adjust the required list to match the current repository state.

Copilot uses AI. Check for mistakes.

- name: Check for large files
run: |
echo "Scanning for files exceeding 100MB..."
large_files=$(find . -type f -size +100M ! -path "./.git/*" ! -path "./node_modules/*" ! -path "./.venv/*" 2>/dev/null)

if [ -n "$large_files" ]; then
echo "❌ ERROR: Large files detected (>100MB):"
echo "$large_files"
exit 1
else
echo "✅ No large files detected"
fi

- name: Validate README sections
run: |
echo "Validating README.md content..."
required_sections=("Overview" "Problem Statement" "Key Capabilities" "System Architecture" "Repository Structure")

for section in "${required_sections[@]}"; do
if grep -q "^## .*$section\|^### .*$section" README.md; then
echo "✅ Found section: $section"
else
echo "⚠️ Section not found in README: $section"
fi
done

- name: Validate file permissions and formats
run: |
echo "Checking file formats and permissions..."
if [ -f "docs/METHODOLOGY.md" ] && [ -f "docs/ASSUMPTIONS.md" ]; then
echo "✅ Required markdown files present"
fi
Comment on lines +71 to +76

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step name says it validates file permissions/formats, but the script only checks for the presence of two markdown files and does nothing (and passes) otherwise. Consider either implementing the actual permission/format checks (e.g., executable bit expectations, line endings, markdown linting) or renaming/removing this step to avoid a misleading validation signal.

Copilot uses AI. Check for mistakes.

- name: Summary
if: success()
run: |
echo "✅ All repository structure validations passed!"
echo "Repository is ready for collaboration."

- name: Failure Summary
if: failure()
run: |
echo "❌ Repository structure validation failed."
echo "Please review the errors above and fix any missing files or directories."
Loading