Weekly sort json #144
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |