Add workflow to validate repository structure - #4
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow intended to enforce a consistent repository layout and basic hygiene checks on pushes and pull requests to main/master.
Changes:
- Introduces
.github/workflows/validate-repo-structure.ymlto verify required directories/files exist. - Adds a scan that fails the job if any tracked file exceeds 100MB.
- Adds a non-blocking README section presence check plus success/failure summaries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| 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 |
There was a problem hiding this comment.
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).
| 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 |
| 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 |
There was a problem hiding this comment.
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.
| - 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 |
There was a problem hiding this comment.
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.
No description provided.