-
Notifications
You must be signed in to change notification settings - Fork 437
41 lines (39 loc) · 1.17 KB
/
docs-check.yml
File metadata and controls
41 lines (39 loc) · 1.17 KB
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
name: Docs Check
on:
workflow_dispatch:
pull_request:
paths:
- 'internal/readme/**'
- 'README.md'
- 'internal/docs/**'
- 'docs/**'
permissions:
contents: read
jobs:
docs-check:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "^1.26"
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Check docs are up-to-date
run: |
go generate ./...
if [ -n "$(git status --porcelain)" ]; then
echo "ERROR: docs are not up-to-date!"
echo ""
echo "The docs differ from what would be generated by go generate ./..."
echo "Please update internal/**/*.src.md instead of directly editing README.md or docs/ files,"
echo "then run go generate ./... to regenerate docs."
echo ""
echo "Changes:"
git status --porcelain
echo ""
echo "Diff:"
git diff
exit 1
fi
echo "Docs are up-to-date."