forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (28 loc) · 1.1 KB
/
json_lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: configs-json-lint
on: [push, pull_request]
jobs:
lint:
name: JSON format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install jq
- name: Check config_example.json format
run: |
jq '.exchanges |= sort_by(.name)' --indent 1 config_example.json > processed_config_example.json
if ! diff config_example.json processed_config_example.json; then
echo "jq differences found in config_example.json! Please run 'make lint_configs'"
exit 1
else
rm processed_config_example.json
fi
- name: Check testdata/configtest.json format
run: |
jq '.exchanges |= sort_by(.name)' --indent 1 testdata/configtest.json > testdata/processed_configtest.json
if ! diff testdata/configtest.json testdata/processed_configtest.json; then
echo "jq differences found in testdata/configtest.json! Please run 'make lint_configs'"
exit 1
else
rm testdata/processed_configtest.json
fi