Skip to content

Commit c93b795

Browse files
authored
ci: validate advisories against OSV JSON schema (#37)
This will help ensure that we're generating valid advisories - while the schema is publically available, I've gone with committing a copy of it to the codebase instead of downloading it since that's a bit simpler and there's a chance we might need to patch it for a period
1 parent b8bd45b commit c93b795

6 files changed

Lines changed: 764 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ jobs:
6161
- run: pipx install poetry~=2.0
6262
- run: poetry install
6363
- run: poetry run pytest
64+
validate:
65+
permissions:
66+
contents: read # to fetch (actions/checkout)
67+
runs-on: ubuntu-latest
68+
timeout-minutes: 15
69+
steps:
70+
- uses: actions/checkout@v4
71+
with:
72+
persist-credentials: false
73+
- uses: actions/setup-python@v5
74+
with:
75+
python-version-file: '.python-version'
76+
- run: pipx install poetry~=2.0
77+
- run: poetry install
78+
- run: poetry run scripts/validate_advisories.py
6479
prettier:
6580
permissions:
6681
contents: read # to fetch (actions/checkout)

.prettierrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,11 @@
1111
"endOfLine": "lf",
1212
"arrowParens": "avoid",
1313
"trailingComma": "none",
14-
"htmlWhitespaceSensitivity": "ignore"
14+
"htmlWhitespaceSensitivity": "ignore",
15+
"overrides": [
16+
{
17+
"files": "schema.json",
18+
"options": { "parser": "json-stringify" }
19+
}
20+
]
1521
}

0 commit comments

Comments
 (0)