forked from hashicorp/waypoint
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.63 KB
/
json-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
46
47
48
49
50
name: json-docs
on:
pull_request:
paths: [embedJson/**]
jobs:
generate-json-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: go.mod
- run: go mod download
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
path: "."
- name: generate json plugin docs
run: go run ./cmd/waypoint docs -json
- run: rm waypoint-restore.db.lock; git status
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
path: "embedJson"
name: docs
check-json-docs:
runs-on: ubuntu-latest
needs:
- generate-json-docs
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
path: "embedJson"
name: docs
- run: git status
- run: |
if ! git diff --exit-code embedJson/gen > /dev/null; then
echo "Website directory has unstaged json changes. This is because you have modified doc strings"
echo "that must be reflected in the json docs. Run the following make command:"
echo
echo "make gen/website-mdx"
echo
echo "And then validate that the corresponding json docs look acceptable."
git status
exit 1
fi
permissions:
contents: read