-
Notifications
You must be signed in to change notification settings - Fork 204
33 lines (31 loc) · 1.19 KB
/
Copy pathdocs-gen.yml
File metadata and controls
33 lines (31 loc) · 1.19 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
name: Docs reference drift
on:
# Narrowed to master: an unfiltered `push` also fires on every topic branch
# and every tag, duplicating the run each pull request already performs.
push:
branches: [ master ]
pull_request:
jobs:
docs-gen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: 1.26
- name: Regenerate the reference
run: make docs-gen
- name: Fail if the generated reference is stale
# The output is staged before diffing because `git diff --exit-code`
# ignores untracked paths: a brand-new command makes the generator emit
# a new cli/<name>.md, and an unstaged diff would pass while that page
# went uncommitted. Diffing the index catches additions alongside
# modifications and deletions.
run: |
git add -A docs/content/en/docs/reference/
if ! git diff --cached --exit-code docs/content/en/docs/reference/; then
echo "::error::The generated CLI reference is out of date. Run 'make docs-gen' and commit the result."
exit 1
fi