Skip to content

Commit 1c585fd

Browse files
ci(workflow): add a GitHub Action to validate JSON schema changes (#258)
This will address the deficiency surfaced in #163 --------- Signed-off-by: Andrew Pollock <[email protected]>
1 parent 4f79ec8 commit 1c585fd

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/validate-schema.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Validate OSV JSON Schema
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types:
8+
- opened
9+
- edited
10+
- reopened
11+
12+
permissions:
13+
pull-requests: read
14+
15+
jobs:
16+
validate-osv-schema:
17+
name: Validate OSV Schema
18+
permissions:
19+
contents: read
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Check for changes to OSV Schema
24+
id: check-for-changed-osv-schema
25+
uses: tj-actions/changed-files@v41
26+
with:
27+
files: |
28+
validation/schema.json
29+
- name: Validate OSV Schema
30+
if: steps.check-for-changed-osv-schema.outputs.any_changed == 'true'
31+
uses: dsanders11/[email protected]
32+
with:
33+
# https://github.com/marketplace/actions/json-schema-validate#validating-schema
34+
schema: json-schema
35+
files: validation/schema.json

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
go.work
2+
go.work.sum

0 commit comments

Comments
 (0)