-
Notifications
You must be signed in to change notification settings - Fork 85
45 lines (41 loc) · 1.57 KB
/
update-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Ensure JSON schema docs are up-to-date
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# When getting Rust dependencies, retry on network error:
CARGO_NET_RETRY: 10
# Use the local .curlrc
CURL_HOME: .
jobs:
check:
name: json-schema-docs-up-to-date:required
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check cargo build
run: cargo build
- name: Show download worked
run: cargo run -- --version
- name: Check for changes
run: |
cargo run -- schema --outfile docs/dfx-json-schema.json
cargo run -- schema --for networks --outfile docs/networks-json-schema.json
cargo run -- schema --for dfx-metadata --outfile docs/dfx-metadata-schema.json
cargo run -- schema --for extension-manifest --outfile docs/extension-manifest-schema.json
cargo run -- schema --for extension-dependencies --outfile docs/extension-dependencies-schema.json
cargo run -- schema --for extension-catalog --outfile docs/extension-catalog-schema.json
echo "JSON Schema changes:"
if git diff --exit-code ; then
echo "(None)"
else
echo
echo "There are code changes in this PR that the JSON schema should reflect,"
echo "but the JSON schema docs have not been updated."
echo
echo "Run the above commands locally to update the JSON schema docs."
exit 1
fi