github: add new workflow for checking json files
Reformat all json files in the repository and check that they're formatted properly.
This commit is contained in:
parent
0799328a6a
commit
7f6dea860a
1 changed files with 17 additions and 0 deletions
17
.github/workflows/check.yml
vendored
17
.github/workflows/check.yml
vendored
|
|
@ -73,3 +73,20 @@ jobs:
|
|||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Check for valid snapshot urls
|
||||
run: ./tools/check-snapshots --errors-only .
|
||||
|
||||
json-fmt:
|
||||
name: "🔍 Check JSON files for formatting consistency"
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Install utils
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y jq moreutils
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Reformat all json files
|
||||
run: find -iname "*.json" -print -exec sh -c 'jq --indent 2 . {} | sponge {}' \;
|
||||
- name: Check diff
|
||||
run: git diff --exit-code
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue