mirror of
https://github.com/Mesteriis/hassio-addons-avm.git
synced 2026-01-09 06:51:03 +01:00
33 lines
864 B
YAML
33 lines
864 B
YAML
# yamllint disable rule:line-length
|
|
---
|
|
name: Weekly sort json
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * 0"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
sort_json:
|
|
if: github.repository_owner == 'alexbelgium'
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
- name: Run script file
|
|
id: sort
|
|
run: |
|
|
for files in */*.json; do
|
|
echo "Sorting $files"
|
|
jq --sort-keys . "$files" > config2.json && cat config2.json > "$files" && rm config2.json
|
|
echo "changed=1" >> "$GITHUB_OUTPUT"
|
|
done
|
|
shell: bash
|
|
- name: Create New Pull Request If Needed
|
|
if: steps.sort.outputs.changed != ''
|
|
uses: peter-evans/create-pull-request@v5
|
|
with:
|
|
title: "Github bot : json sorted"
|
|
branch-suffix: timestamp
|
|
commit-message: "Github bot : json sorted"
|