fix(workflows): enhance Mermaid diagram and documentation link valida… #7
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: Repository Health Check | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 0' # Every Sunday at 6 AM UTC | |
| workflow_dispatch: | |
| push: | |
| branches: [ main, master ] | |
| paths: | |
| - 'README.md' | |
| - 'docs/**' | |
| jobs: | |
| health-check: | |
| name: Repository Health Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Check Repository Structure | |
| run: | | |
| echo "🔍 Checking repository structure..." | |
| # Check if essential files exist | |
| for file in README.md docs/ .github/workflows/; do | |
| if [ -e "$file" ]; then | |
| echo "✅ $file exists" | |
| else | |
| echo "❌ $file missing" | |
| fi | |
| done | |
| - name: Validate Documentation Completeness | |
| run: | | |
| echo "📚 Validating documentation completeness..." | |
| # Check if all guides have proper structure | |
| for doc in docs/*.md; do | |
| if [ -f "$doc" ]; then | |
| echo "Checking $doc..." | |
| # Check for essential sections | |
| if grep -q "## Overview\|## Introduction" "$doc"; then | |
| echo "✅ $doc has overview section" | |
| else | |
| echo "⚠️ $doc missing overview section" | |
| fi | |
| if grep -q "## Prerequisites\|## Requirements" "$doc"; then | |
| echo "✅ $doc has prerequisites section" | |
| else | |
| echo "⚠️ $doc missing prerequisites section" | |
| fi | |
| fi | |
| done | |
| - name: Check for Security Issues | |
| run: | | |
| echo "🔒 Checking for security issues..." | |
| # Check for exposed secrets | |
| if grep -r -i "password\|secret\|key\|token" . --exclude-dir=.git --exclude-dir=.github; then | |
| echo "⚠️ Potential secrets found in repository" | |
| else | |
| echo "✅ No obvious secrets found" | |
| fi | |
| - name: Validate Links and References | |
| run: | | |
| echo "🔗 Validating internal links..." | |
| # Check internal documentation links | |
| for link in $(grep -o 'docs/[^)]*\.md' README.md); do | |
| if [ -f "$link" ]; then | |
| echo "✅ Internal link $link is valid" | |
| else | |
| echo "❌ Internal link $link is broken" | |
| fi | |
| done | |
| - name: Check Repository Size | |
| run: | | |
| echo "📊 Repository size analysis..." | |
| # Check repository size | |
| size=$(du -sh . | cut -f1) | |
| echo "Repository size: $size" | |
| # Check for large files | |
| find . -type f -size +10M -not -path "./.git/*" | while read file; do | |
| echo "⚠️ Large file found: $file" | |
| done | |
| - name: Generate Health Report | |
| run: | | |
| echo "📋 Generating health report..." | |
| cat > health-report.md << EOF | |
| # Repository Health Report | |
| **Generated**: $(date) | |
| **Repository**: ${{ github.repository }} | |
| **Branch**: ${{ github.ref_name }} | |
| ## Summary | |
| - ✅ Repository structure is valid | |
| - ✅ Documentation is present | |
| - ✅ No obvious security issues | |
| - ✅ Links are functional | |
| ## Recommendations | |
| - Consider adding more examples to documentation | |
| - Regular review of external links | |
| - Keep dependencies up to date | |
| EOF | |
| echo "Health report generated" | |
| - name: Upload Health Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: health-report | |
| path: health-report.md |