Replace json-schema with check-jsonschema (#103)

Signed-off-by: Gonzalo Gomez Gracia <gonzalog@vmware.com>
This commit is contained in:
Gonzalo Gómez Gracia 2023-07-28 12:14:17 +02:00 committed by GitHub
parent 1ad3c6931c
commit 2a7f74f389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -25,8 +25,8 @@ jobs:
run: sudo apt-get install -y jq python3
- name: Install markdownlint
run: npm install -g markdownlint-cli@0.33.0
- name: Install jsonschema
run: python3 -m pip install jsonschema
- name: Install check-jsonschema
run: python3 -m pip install check-jsonschema
- uses: actions/checkout@v3
name: Checkout Repository
- id: lint

View File

@ -19,6 +19,7 @@ elif [[ "$FORCE" -eq 1 ]] && [[ "${#files_to_check[@]}" -eq 0 ]]; then
fi
if [[ "${#files_to_check[@]}" -ne 0 ]]; then
echo "Will check ${#files_to_check[@]} files"
for f in "${files_to_check[@]}"; do
if [[ -f "$f" ]]; then
# Run a different linter depending on file extension
@ -38,7 +39,7 @@ if [[ "${#files_to_check[@]}" -ne 0 ]]; then
exit_code=$?
elif [[ "$f" =~ .*\/?data\/.* ]]; then
# Check CVE file against OSV schema
output="$(jsonschema "${root_dir}/config/validation/schema.json" < "$f" 2>/dev/null)"
check-jsonschema --verbose --schemafile "${root_dir}/config/validation/schema.json" "$f"
exit_code=$?
fi
if [[ $exit_code -ne 0 ]]; then