WhatsMyName/.github/workflows/sort-format-json.yml

32 lines
793 B
YAML

name: Sort and Format JSON Files
on:
push:
paths:
- 'wmn-data.json'
- 'wmn-data-schema.json'
jobs:
sort-and-format-json:
name: Sort and Format JSON Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Run Python sorting script
run: python scripts/sort_wmn_data.py
- name: Commit if changed
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git add wmn-data.json wmn-data-schema.json
git diff --cached --quiet || git commit -m "chore: auto-sort and format JSON files"
git push