diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a0a432..a9b85fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,13 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Validate JSON Formatting + - name: Format JSON run: | ./scripts/ci/format-json.sh - if ! git diff-index --quiet HEAD; then - echo "Run ./scripts/ci/format-json.sh to reformat the JSON data" - exit 1 - fi + - name: Ensure no formatting changes needed + run: git diff --exit-code - name: Validate JSON schemas run: | ./scripts/ci/check-json-schemas.sh diff --git a/scripts/ci/check-json-schemas.sh b/scripts/ci/check-json-schemas.sh index a683511..445dfb6 100755 --- a/scripts/ci/check-json-schemas.sh +++ b/scripts/ci/check-json-schemas.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + mapfile -t schemas < <(git grep -Fl 'https://json-schema.org' '**/*.json') function runTest() { diff --git a/scripts/ci/sdk-consistency.sh b/scripts/ci/sdk-consistency.sh index 69174b0..c546fbb 100755 --- a/scripts/ci/sdk-consistency.sh +++ b/scripts/ci/sdk-consistency.sh @@ -17,7 +17,7 @@ for file in ./data/*.json; do continue fi jq -r 'keys[]' "$file" | sort > "$file.keys" - if diff -q sdks.json.keys "$file.keys" > /dev/null; then + if diff -q ./data/sdks.json.keys "$file.keys" > /dev/null; then echo "$file is consistent" else echo "$file is missing some SDK IDs:"