Skip to content

Commit

Permalink
ci(workflow): add a GitHub Action to validate JSON schema changes (#258)
Browse files Browse the repository at this point in the history
This will address the deficiency surfaced in #163

---------

Signed-off-by: Andrew Pollock <[email protected]>
  • Loading branch information
andrewpollock authored Aug 28, 2024
1 parent 4f79ec8 commit 1c585fd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/validate-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Validate OSV JSON Schema

on:
pull_request:
branches:
- main
types:
- opened
- edited
- reopened

permissions:
pull-requests: read

jobs:
validate-osv-schema:
name: Validate OSV Schema
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for changes to OSV Schema
id: check-for-changed-osv-schema
uses: tj-actions/changed-files@v41
with:
files: |
validation/schema.json
- name: Validate OSV Schema
if: steps.check-for-changed-osv-schema.outputs.any_changed == 'true'
uses: dsanders11/[email protected]
with:
# https://github.com/marketplace/actions/json-schema-validate#validating-schema
schema: json-schema
files: validation/schema.json
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
go.work
go.work.sum

0 comments on commit 1c585fd

Please sign in to comment.