diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index c94954f..f00a605 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -59,6 +59,10 @@ jobs: mkdir -p $DATA_DIR/$YEAR docker run --rm -v $PWD:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools osv "$FILE" > $DATA_DIR/$YEAR/$ID.json done < <(find advisories -type f -name "*.md" | grep -v '^advisories/reserved/') + - name: Validate OSV data + run: | + curl -OL https://raw.githubusercontent.com/ossf/osv-schema/refs/heads/main/validation/schema.json + nix develop .#json-schema --command check-jsonschema --schemafile ./schema.json ./osv/*/*.json - name: Publish OSV data if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'haskell/security-advisories' }} env: diff --git a/flake.nix b/flake.nix index d163def..965f066 100644 --- a/flake.nix +++ b/flake.nix @@ -106,5 +106,6 @@ # Used by `nix develop` (dev shell) devShell = hsec-tools true; + devShells.json-schema = pkgs.mkShell { buildInputs = [ pkgs.check-jsonschema ]; }; }); }