diff --git a/.github/workflows/jsonlint.yml b/.github/workflows/jsonlint.yml new file mode 100644 index 000000000..d3c2abc92 --- /dev/null +++ b/.github/workflows/jsonlint.yml @@ -0,0 +1,24 @@ +name: Check Json format + +on: [push, pull_request] + +jobs: + jsonlint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.2.0 + - name: Get Diff Action + uses: technote-space/get-diff-action@v1.2.8 + with: + SUFFIX_FILTER: .json + - name: Install node + run: | + sudo apt install nodejs + - name: Install jsonlint + run: | + sudo npm install -g jsonlint + - name: Lint with jsonlint + run: | + for file in ${{ env.GIT_DIFF }}; do npx jsonlint $file; done + if: env.GIT_DIFF