Skip to content

(Feat) add YAML and JSON linter on github actions #2

(Feat) add YAML and JSON linter on github actions

(Feat) add YAML and JSON linter on github actions #2

Workflow file for this run

name: Lint YAML and JSON
on:
push:
paths:
- '**/*.yml'
- '**/*.yaml'
- '**/*.json'
pull_request:
paths:
- '**/*.yml'
- '**/*.yaml'
- '**/*.json'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install linters
run: |
pip install yamllint
pip install jsonlint
- name: Lint YAML files
run: |
yamllint .
- name: Lint JSON files
run: |
find . -name '*.json' -exec jsonlint -q {} \;
- name: Display linter versions (Optional)
run: |
yamllint --version
jsonlint --version