Skip to content

chore: add gh-token for update cve task #8

chore: add gh-token for update cve task

chore: add gh-token for update cve task #8

Workflow file for this run

name: JSON Schema Validation
on:
pull_request:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # For git diff
- name: Download the JSON schema
run: wget https://raw.githubusercontent.com/ossf/osv-schema/v1.6.0/validation/schema.json
- name: Install check-jsonschema
run: pip install check-jsonschema
- name: Validate JSON
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep .json) && : // Ignore errors
if [ -n "$CHANGED_FILES" ]; then
echo "Validating JSON files: $CHANGED_FILES"
check-jsonschema --schemafile schema.json $CHANGED_FILES
else
echo "No JSON files changed. Skipping validation."
fi