Scripts Directory

This directory contains automation scripts and tools for the IT-Journey project.

The Link Health Guardian is a unified, comprehensive link checking system for the IT-Journey website. It provides automated link validation, intelligent analysis, and GitHub integration with minimal workflow complexity.

🚀 Features

� File Structure

scripts/
└── link-checker.py          # Single unified script with all functionality

.github/workflows/
└── link-checker.yml         # Minimal workflow that calls the Python script

🔧 Usage

Manual Execution

# Basic website check
python3 scripts/link-checker.py --scope website

# Comprehensive analysis with AI
python3 scripts/link-checker.py --scope website --analysis-level comprehensive

# Create GitHub issue with results
python3 scripts/link-checker.py --scope website --create-issue --repository bamr87/it-journey

# Check specific content types
python3 scripts/link-checker.py --scope posts
python3 scripts/link-checker.py --scope quests  
python3 scripts/link-checker.py --scope docs

GitHub Actions Workflow

The workflow can be triggered:

  1. Manually via GitHub Actions UI with configurable options
  2. Scheduled runs:
    • Monday at 6 AM UTC (weekly comprehensive check)
    • Friday at 6 PM UTC (end-of-week validation)

Configuration Options

Parameter Description Options
scope Content to check website, internal, external, docs, posts, quests, all
analysis-level Analysis depth basic, standard, comprehensive, ai-only
timeout Request timeout 10, 20, 30, 45, 60 seconds
create-issue Create GitHub issue true, false
ai-analysis Enable AI analysis true, false

🧠 AI Analysis

When enabled, the AI analysis provides:

📊 Output Files

The script generates comprehensive output in the specified directory:

🔄 Workflow Integration

The unified approach provides:

  1. Single Point of Execution: All logic in one Python script
  2. Minimal Workflow Complexity: GitHub Actions simply calls the script
  3. Consistent Results: Same behavior whether run locally or in CI
  4. Easy Maintenance: Updates only require modifying the Python script
  5. Comprehensive Outputs: All results available for workflow decisions

🛠️ Development

Requirements

Environment Variables

Testing

# Test with dry run (no actual changes)
python3 scripts/link-checker.py --scope website --dry-run

# Test specific analysis level
python3 scripts/link-checker.py --scope internal --analysis-level basic

# Test without AI (faster execution)
python3 scripts/link-checker.py --scope docs --no-ai

📈 Architecture Benefits

Before: Complex Modular Approach

After: Unified Single-Script Approach

🏗️ Development Scripts

Core Scripts

Deployment Scripts

Content Scripts

Generated Scripts

🔧 Usage Guidelines

Local Development

  1. Clone the repository
  2. Install Python dependencies: pip install requests
  3. Run link checker locally: python3 scripts/link-checker.py --scope website --verbose

CI/CD Integration

  1. Set OPENAI_API_KEY secret in GitHub repository settings (optional for AI analysis)
  2. Workflow runs automatically on schedule (Monday 6 AM UTC, Friday 6 PM UTC)
  3. Review issues created by the guardian when broken links are detected
  4. Fix broken links as recommended by the AI analysis

Customization

📚 Educational Value

The Link Health Guardian system exemplifies several key DevOps and automation concepts:

This system serves as both a practical tool and an educational example of modern DevOps practices in action.

IT-Journey Documentation

External Documentation

🤝 Contributing

When adding new scripts:

  1. Follow the existing naming conventions
  2. Include comprehensive help documentation
  3. Add error handling and logging
  4. Update this README with usage examples
  5. Consider educational value and learning opportunities

For the Link Health Guardian system specifically: