From 2c5082acbcfbef08edb96dc532146cd5b723265c Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Sun, 19 Jan 2025 22:18:39 +0800 Subject: [PATCH] check json format on pull request --- .github/workflows/json-lint.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/json-lint.yml diff --git a/.github/workflows/json-lint.yml b/.github/workflows/json-lint.yml new file mode 100644 index 0000000..f0507ea --- /dev/null +++ b/.github/workflows/json-lint.yml @@ -0,0 +1,31 @@ +name: pr_jsonlint + +on: + pull_request: + paths: + - 'module/webui/locales/*.json' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install JSON linter + run: npm install -g jsonlint + + - name: Lint JSON files + run: | + for file in $(find module/webui/locales -name "*.json"); do + echo "Checking $file" + if ! jsonlint "$file"; then + echo "Error in $file" + exit 1 + fi + done \ No newline at end of file