Files
hassio-addons/.github/workflows/sort_json.yaml
2022-03-15 14:12:49 +01:00

22 lines
446 B
YAML

# yamllint disable rule:line-length
---
name: Sort Json
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
sort_json:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Run script file
run: |
for files in */*.json; do
echo "Sorting $files"
jq --sort-keys . "$files" > config2.json && cat config2.json > "$files" && rm config2.json
done
shell: bash