Skip to content

Commit e7084cd

Browse files
authored
chore: update schemas only when a release is done (#2211)
1 parent ca55e9b commit e7084cd

File tree

4 files changed

+809
-4
lines changed

4 files changed

+809
-4
lines changed

.github/workflows/lint.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,19 @@ jobs:
5656
with:
5757
script: |
5858
core.setFailed('website/versioned_docs has changed. Instead you need to update the docs in the website/docs folder.')
59+
check_schema:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Get changed files in the docs folder
64+
id: changed-files-specific
65+
uses: tj-actions/changed-files@v46
66+
with:
67+
files: |
68+
website/static/schema.json
69+
website/static/schema-taskrc.json
70+
- uses: actions/github-script@v7
71+
if: steps.changed-files-specific.outputs.any_changed == 'true'
72+
with:
73+
script: |
74+
core.setFailed('schema.json or schema-taskrc.json has changed. Instead you need to update next-schema.json or next-schema-taskrc.json.')

cmd/release/main.go

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ import (
1616
)
1717

1818
const (
19-
changelogSource = "CHANGELOG.md"
20-
changelogTarget = "website/docs/changelog.mdx"
21-
docsSource = "website/docs"
22-
docsTarget = "website/versioned_docs/version-latest"
19+
changelogSource = "CHANGELOG.md"
20+
changelogTarget = "website/docs/changelog.mdx"
21+
docsSource = "website/docs"
22+
docsTarget = "website/versioned_docs/version-latest"
23+
schemaSource = "website/static/next-schema.json"
24+
schemaTarget = "website/static/schema.json"
25+
schemaTaskrcSource = "website/static/next-schema-taskrc.json"
26+
schemaTaskrcTarget = "website/static/schema-taskrc.json"
2327
)
2428

2529
var (
@@ -83,6 +87,10 @@ func release() error {
8387
return err
8488
}
8589

90+
if err := schema(); err != nil {
91+
return err
92+
}
93+
8694
return nil
8795
}
8896

@@ -175,3 +183,13 @@ func docs() error {
175183
}
176184
return nil
177185
}
186+
187+
func schema() error {
188+
if err := copy.Copy(schemaSource, schemaTarget); err != nil {
189+
return err
190+
}
191+
if err := copy.Copy(schemaTaskrcSource, schemaTaskrcTarget); err != nil {
192+
return err
193+
}
194+
return nil
195+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"title": "Taskrc YAML Schema",
4+
"description": "Schema for .taskrc files.",
5+
"type": "object",
6+
"properties": {
7+
"experiments": {
8+
"type": "object",
9+
"additionalProperties": {
10+
"type": "integer"
11+
}
12+
}
13+
},
14+
"additionalProperties": false
15+
}

0 commit comments

Comments
 (0)