Skip to content

Commit be0d18e

Browse files
authored
Add scripts/validate-structure.js validation script (#3)
2 parents c082720 + 3d5499c commit be0d18e

5 files changed

Lines changed: 1952 additions & 4 deletions

File tree

.github/workflows/validate.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Validate GAP Structure
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
validate:
11+
name: Validate GAP directories
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "24"
22+
cache: "npm"
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Validate GAP structure
28+
run: npm run test:structure

metadata.schema.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://raw.githubusercontent.com/graphql/gaps/main/metadata.schema.json",
4+
"title": "GAP Metadata",
5+
"type": "object",
6+
"properties": {
7+
"title": { "type": "string" },
8+
"status": { "type": "string", "enum": ["proposal", "draft", "accepted"] },
9+
"authors": { "type": "array", "items": { "type": "string" } },
10+
"sponsor": { "type": "string" },
11+
"discussion": { "type": "string" },
12+
"id": { "type": "integer" },
13+
"related": { "type": "array", "items": { "type": "integer" } },
14+
"replaces": { "type": "integer" },
15+
"supersededBy": { "type": "integer" },
16+
"tags": { "type": "array", "items": { "type": "string" } }
17+
},
18+
"required": ["id", "title", "status", "authors", "sponsor", "discussion"],
19+
"additionalProperties": false
20+
}

0 commit comments

Comments
 (0)