Skip to content

qa: Enforce JSON lint for GCT configs #2

qa: Enforce JSON lint for GCT configs

qa: Enforce JSON lint for GCT configs #2

Workflow file for this run

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