Skip to content

Merge branch 'CVEProject:main' into revert-4-revert-1-Makotogew-patch-1 #29

Merge branch 'CVEProject:main' into revert-4-revert-1-Makotogew-patch-1

Merge branch 'CVEProject:main' into revert-4-revert-1-Makotogew-patch-1 #29

name: Update validate-schema.yml
Validate JSON Schemas

Check failure on line 2 in .github/workflows/validate-schema.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/validate-schema.yml

Invalid workflow file

You have an error in your yaml syntax on line 2
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
branches - master
env:
CVE_SCHEMA_DIR: schema
CVE_SCHEMA_FILENAME: CVE_Record_Format.json
jobs:
verify-json-validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install NPM dependencies (i.e., ajv)
run: |
sudo npm install --loglevel verbose -g yargs ajv-formats@"^1.5.x" ajv-cli@"^4.0.x"
- name: Install schema2markmap NPM dependencies
run: |
npm --prefix "${CVE_SCHEMA_DIR}/support/schema2markmap" install "${CVE_SCHEMA_DIR}/support/schema2markmap"
# Rename the schema, since AJV doesn't like non-".json" extensions
- name: Prepare schema for bundling
run: |
sed 's/file\://g' "${CVE_SCHEMA_DIR}/${CVE_SCHEMA_FILENAME}" > "${CVE_SCHEMA_DIR}/cve-schema.json"
- name: Bundle schema for AJV
run: |
node "${CVE_SCHEMA_DIR}/support/schema2markmap/schema-bundle.js" "${CVE_SCHEMA_DIR}/cve-schema.json" "${CVE_SCHEMA_DIR}/docs/"
- name: Validate JSON schema
run: |
ajv compile -c ajv-formats -s "${CVE_SCHEMA_DIR}/docs/CVE_Record_Format_bundled.json"
ajv validate -c ajv-formats -s "${CVE_SCHEMA_DIR}/docs/CVE_Record_Format_bundled.json" -d "${CVE_SCHEMA_DIR}/docs/full-record-basic-example.json"
ajv validate -c ajv-formats -s "${CVE_SCHEMA_DIR}/docs/CVE_Record_Format_bundled.json" -d "${CVE_SCHEMA_DIR}/docs/full-record-advanced-example.json"
ajv validate -c ajv-formats -s "${CVE_SCHEMA_DIR}/docs/CVE_Record_Format_bundled_cnaPublishedContainer.json" -d "${CVE_SCHEMA_DIR}/docs/cnaContainer-advanced-example.json"
ajv validate -c ajv-formats -s "${CVE_SCHEMA_DIR}/docs/CVE_Record_Format_bundled_cnaPublishedContainer.json" -d "${CVE_SCHEMA_DIR}/docs/cnaContainer-basic-example.json"