mirror of
https://github.com/mustbeperfect/definitive-opensource.git
synced 2026-04-17 21:54:05 +02:00
Fixed directories for format-maintenance update
This commit is contained in:
15
.github/workflows/format-maintenance.yml
vendored
15
.github/workflows/format-maintenance.yml
vendored
@@ -8,6 +8,9 @@ on:
|
||||
jobs:
|
||||
generate:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: core
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -19,24 +22,22 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
persist-credentials: true
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version-file: ".python-version"
|
||||
|
||||
- name: Install UV
|
||||
uses: astral-sh/setup-uv@v7
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install
|
||||
|
||||
- name: Install project
|
||||
run: uv sync --no-dev
|
||||
|
||||
- name: Run script to check for format errors
|
||||
run: uv run ./core/source/maintenance/json_formatter.py
|
||||
run: uv run source/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 resources/maintenance/format_maintenance.md
|
||||
git add ../resources/maintenance/format_maintenance.md
|
||||
git diff --quiet && git diff --staged --quiet || git commit -m "Format Maintenance"
|
||||
git push
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import json
|
||||
|
||||
with open("core/data/dynamic/applications.json") as f:
|
||||
with open("data/dynamic/applications.json") as f:
|
||||
applications = json.load(f)["applications"]
|
||||
|
||||
with open("core/data/static/categories.json") as f:
|
||||
with open("data/static/categories.json") as f:
|
||||
categories_data = json.load(f)["subcategories"]
|
||||
valid_categories = {c["id"].lower() for c in categories_data}
|
||||
|
||||
with open("core/data/static/platforms.json") as f:
|
||||
with open("data/static/platforms.json") as f:
|
||||
platforms_data = json.load(f)["platforms"]
|
||||
valid_platforms = {p["id"].lower() for p in platforms_data}
|
||||
|
||||
@@ -45,7 +45,7 @@ for app in applications:
|
||||
{"name": app.get("name", "Unnamed Project"), "issues": app_issues}
|
||||
)
|
||||
|
||||
with open("resources/maintenance/format_maintenance.md", "w") as f:
|
||||
with open("../resources/maintenance/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")
|
||||
|
||||
Reference in New Issue
Block a user