v2
This commit is contained in:
31
.github/workflows/weekly_sortjson.yaml
vendored
Normal file
31
.github/workflows/weekly_sortjson.yaml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# yamllint disable rule:line-length
|
||||
---
|
||||
name: Weekly sort json
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sort_json:
|
||||
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"
|
||||
Reference in New Issue
Block a user