vermaanurag1532 / WHILE_APP

MIT License
11 stars 25 forks source link

Add JSON Syntax Validation Github action ⚡ #62

Closed Nishitbaria closed 1 year ago

Nishitbaria commented 1 year ago

Description: I would like to suggest an enhancement to the existing workflow "JSON check" to include a step that checks whether the JSON syntax is valid or not. This will help ensure that the JSON files in the repository are correctly formatted and avoid potential issues caused by invalid JSON.

Demo Code of Workflow :

name: JSON check

on:
  push:
    paths:
      - "**.json"
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: json-syntax-check
        uses: limitusus/json-syntax-check@v2
        with:
          pattern: "\\.json$"
      - name: json-validation
        run: |
          # Add a step here to perform JSON syntax validation
          # You can use a tool like `jq` or a custom script to validate the JSON syntax
          # For example, you can use the following command:
          #   jq empty < your_file.json