Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema validation #1

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validate Schema
on:
pull_request:

concurrency:
group: validate-schema-${{ github.ref_name }}
cancel-in-progress: true

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Schema
uses: caido/action-json-schema-validate:3d80261c1f49e8664a6311b08c5809127cfc4a91
with:
schema: schema.json
files: plugin_packages.json
fail-on-invalid: true
cache-remote-schema: false
1 change: 1 addition & 0 deletions plugin_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"id": "autorize",
"name": "Autorize",
"license": "MIT",
"description": "Automated access control testing plugin for Caido",
"author": {
"name": "Caido Labs Inc.",
Expand Down
42 changes: 42 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"license": {
"type": "string"
},
"description": {
"type": "string"
},
"author": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"url": {
"type": "string",
"format": "uri"
}
},
"required": ["name", "email", "url"]
},
"repository": {
"type": "string"
}
},
"required": ["id", "name", "license", "description", "author", "repository"]
}
}