From 7f6dea860a21faf9f4f9cc243f49a429c1d15945 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 25 Mar 2024 18:07:15 +0100 Subject: [PATCH] github: add new workflow for checking json files Reformat all json files in the repository and check that they're formatted properly. --- .github/workflows/check.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e9c192d7..34d9a279 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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