Skip to content

Commit

Permalink
Add lint step before commit
Browse files Browse the repository at this point in the history
Signed-off-by: nythepegasus <[email protected]>
  • Loading branch information
nythepegasus authored Oct 22, 2024
1 parent ec0d2d0 commit b05a61e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/lint-json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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

0 comments on commit b05a61e

Please sign in to comment.