Skip to content

The definitive list of the best of (consumer facing) open source.

Completed maintenance script and action workflow

Lucasac5053cf2904
diff --git a/.github/workflows/format-maintenance.yml b/.github/workflows/format-maintenance.yml
new file mode 100644
index 0000000..6917160
--- /dev/null
+++ b/.github/workflows/format-maintenance.yml
@@ -0,0 +1,39 @@
+
+name: Format Maintenance
+
+on:
+ push:
+ paths:
+ - 'source/data/**'
+
+jobs:
+ generate:
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ persist-credentials: true
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.x'
+
+ - name: Install dependencies
+ run: pip install -r requirements.txt || true
+
+ - name: Run script to check for format errors
+ run: python ./source/scripts/maintenance/json_formatter.py
+
+ - name: Commit and push changes
+ run: |
+ git config --global user.name "github-actions[bot]"
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
+ git add readmes/format_maintenence.md
+ git diff --quiet && git diff --staged --quiet || git commit -m "Format Maintenance"
+ git push
diff --git a/.github/workflows/status-maintenance.yml b/.github/workflows/status-maintenance.yml
new file mode 100644
index 0000000..cd26411
--- /dev/null
+++ b/.github/workflows/status-maintenance.yml
@@ -0,0 +1,39 @@
+
+name: Status Maintenance
+
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: '0 2 * * 1' # every Monday at 2:00 AM UTC
+
+jobs:
+ generate:
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+ persist-credentials: true
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.x'
+
+ - name: Install dependencies
+ run: pip install -r requirements.txt || true
+
+ - name: Run script to check for project status
+ run: python ./source/scripts/maintenance/status_checker.py
+
+ - name: Commit and push changes
+ run: |
+ git config --global user.name "github-actions[bot]"
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
+ git add readmes/status_maintenence.md
+ git diff --quiet && git diff --staged --quiet || git commit -m "Status Check"
+ git push
diff --git a/source/data/dynamic/format_maintenance.json b/source/data/dynamic/format_maintenance.json
deleted file mode 100644
index e69de29..0000000
diff --git a/source/data/dynamic/status_maintenence.json b/source/data/dynamic/status_maintenence.json
deleted file mode 100644
index e69de29..0000000
diff --git a/source/scripts/maintenance/json_formatter.py b/source/scripts/maintenance/json_formatter.py
index e69de29..916b4ce 100644
--- a/source/scripts/maintenance/json_formatter.py
+++ b/source/scripts/maintenance/json_formatter.py
@@ -0,0 +1,59 @@
+import json
+
+with open("source/data/dynamic/applications.json") as f:
+ applications = json.load(f)["applications"]
+
+with open("source/data/static/categories.json") as f:
+ categories_data = json.load(f)["subcategories"]
+ valid_categories = {c["id"].lower() for c in categories_data}
+
+with open("source/data/static/platforms.json") as f:
+ platforms_data = json.load(f)["platforms"]
+ valid_platforms = {p["id"].lower() for p in platforms_data}
+
+seen_github = set()
+issues_report = []
+
+for app in applications:
+ app_issues = []
+
+ github_url = app.get("repo_url", "").strip()
+ if not github_url:
+ app_issues.append("Missing GitHub URL")
+ elif github_url in seen_github:
+ app_issues.append("Duplicate GitHub URL")
+ else:
+ seen_github.add(github_url)
+
+ category = app.get("category", "").lower()
+ if not category:
+ app_issues.append("Missing category")
+ elif category not in valid_categories:
+ app_issues.append(f"Invalid category '{category}'")
+
+ platforms = [p.lower() for p in app.get("platforms", [])]
+ if not platforms:
+ app_issues.append("Missing platform")
+ else:
+ invalid_platforms = [p for p in platforms if p not in valid_platforms]
+ if invalid_platforms:
+ app_issues.append(f"Invalid platforms: {', '.join(invalid_platforms)}")
+
+ if app_issues:
+ issues_report.append({
+ "name": app.get("name", "Unnamed Project"),
+ "issues": app_issues
+ })
+
+with open("readmes/format_maintenance.md", "w") as f:
+ f.write("# Format Maintenance Report\n\n")
+ if not issues_report:
+ f.write("No issues found. All applications are properly formatted.\n")
+ else:
+ for entry in issues_report:
+ f.write(f"## {entry['name']}\n")
+ for issue in entry["issues"]:
+ f.write(f"- {issue}\n")
+ f.write("\n")
+
+print("Maintenance report generated: format_maintenance.md")