Skip to content

Add lint step before commit #1

Add lint step before commit

Add lint step before commit #1

Workflow file for this run

name: Lint JSON
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
json-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache APT packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-cache
restore-keys: |
${{ runner.os }}-apt-cache
- name: Update APT cache
run: sudo apt-get update
- name: Install jq
run: sudo apt-get install -y jq
- name: Lint servers.json
run: |
if ! jq empty servers.json; then
echo "Invalid JSON file detected in servers.json"
exit 1
else
echo "servers.json is valid"
fi