🚀 RebelDev - Auto Config Scanner #4647
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
| # ============================================================================= | |
| # RebelDev Auto Scanner - GitHub Actions Workflow | |
| # ============================================================================= | |
| name: "🚀 RebelDev - Auto Config Scanner" | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' | |
| workflow_dispatch: | |
| inputs: | |
| force_refresh: | |
| description: 'Force refresh all configurations' | |
| required: false | |
| default: false | |
| type: boolean | |
| push: | |
| branches: [ main ] | |
| env: | |
| PYTHON_VERSION: '3.12' | |
| SCANNER_VERSION: '4.8.0' | |
| jobs: | |
| improved-scan-and-deploy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: "🔄 Checkout Repository" | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: "🐍 Setup Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: 'pip' | |
| - name: "📦 Install Dependencies" | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install aiohttp requests | |
| - name: "🔧 Setup System Permissions" | |
| run: | | |
| sudo sysctl -w net.ipv4.ping_group_range="0 2147483647" || true | |
| sudo apt-get update && sudo apt-get install -y curl || true | |
| - name: "🧹 Clean Cache" | |
| run: | | |
| rm -rf RebelLink || true | |
| - name: "🚀 Run Scanner" | |
| run: | | |
| echo "Starting scan v${{ env.SCANNER_VERSION }}..." | |
| timeout 40m python auto_scanner.py | |
| - name: "✅ Validate Output" | |
| run: | | |
| echo "Validating generated configurations..." | |
| if [ -d "RebelLink" ]; then | |
| sub_count=$(find RebelLink -name "*_subscriptions.txt" -type f | wc -l) | |
| echo "Found $sub_count subscription files" | |
| if [ -f "RebelLink/performance_report.json" ]; then | |
| echo 'import json' > validate_report.py | |
| echo 'try:' >> validate_report.py | |
| echo ' with open("RebelLink/performance_report.json") as f:' >> validate_report.py | |
| echo ' r = json.load(f)' >> validate_report.py | |
| echo ' print("✅ Scan completed: " + r["scan_timestamp"])' >> validate_report.py | |
| echo ' print("📋 Processed: " + str(r["performance_metrics"]["total_processed"]))' >> validate_report.py | |
| echo ' print("✅ Valid: " + str(r["performance_metrics"]["valid_configs"]))' >> validate_report.py | |
| echo ' print("📊 Success rate: " + str(r["performance_metrics"]["success_rate"]) + "%")' >> validate_report.py | |
| echo ' print("⚡ Avg Latency: " + str(r["performance_metrics"]["avg_latency_ms"]) + "ms")' >> validate_report.py | |
| echo ' print("⭐ Avg Score: " + str(r["performance_metrics"]["avg_score"]))' >> validate_report.py | |
| echo 'except Exception as e:' >> validate_report.py | |
| echo ' print("⚠️ Report read error: " + str(e))' >> validate_report.py | |
| python validate_report.py | |
| rm validate_report.py | |
| else | |
| echo "⚠️ performance_report.json not found" | |
| exit 1 | |
| fi | |
| else | |
| echo "❌ RebelLink folder missing" | |
| exit 1 | |
| fi | |
| echo "✅ Validation passed" | |
| - name: "🔄 Deploy Configurations" | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "RebelDev Improved Scanner" | |
| if git diff --quiet HEAD -- RebelLink/; then | |
| echo "🟡 No configuration changes detected" | |
| else | |
| git add RebelLink/ | |
| valid_count=$(python -c "import json; d=json.load(open('RebelLink/performance_report.json')); print(d['performance_metrics']['valid_configs'])") | |
| timestamp=$(date -u +"%Y-%m-%d %H:%M:%S UTC") | |
| git commit -m "🤖 Auto-Update: ${timestamp}" \ | |
| -m "v${{ env.SCANNER_VERSION }} - ${valid_count} valid configs" | |
| git push | |
| fi | |
| - name: "📤 Upload Artifacts" | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rebeldev-scan-results | |
| path: | | |
| RebelLink/ | |
| scanner.log | |
| retention-days: 7 | |
| if-no-files-found: ignore |