From 4117eea0d43e00409801499f00e9afa2b70ea491 Mon Sep 17 00:00:00 2001 From: Ishan Rai Date: Sat, 27 Jun 2020 16:14:15 +0530 Subject: [PATCH] add json lint actions --- .github/workflows/jsonlint.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/jsonlint.yml 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