Skip to content

Commit f14c95e

Browse files
authored
feat(ci): add api docs lint (#126)
Signed-off-by: ashing <[email protected]>
1 parent 8ba5d71 commit f14c95e

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: golangci-lint
1+
name: lint
22

33
on:
44
push:
@@ -26,3 +26,23 @@ jobs:
2626

2727
- name: 🛩️ golangci-lint
2828
run: make lint
29+
crd-docs-check:
30+
name: Check CRD Docs
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Download crd-ref-docs
35+
run: |
36+
mkdir -p ./bin
37+
curl -L -o ./bin/crd-ref-docs.tar.gz https://github.com/elastic/crd-ref-docs/releases/download/v0.1.0/crd-ref-docs_0.1.0_Linux_x86_64.tar.gz
38+
tar -xzvf ./bin/crd-ref-docs.tar.gz -C ./bin
39+
chmod +x ./bin/crd-ref-docs
40+
- name: Generate CRD Docs
41+
run: |
42+
make generate-crd-docs
43+
- name: Check CRD Docs Diff
44+
run: |
45+
if ! git diff --exit-code -- docs/crd/api.md; then
46+
echo "docs/crd/api.md has changed. Please run 'make generate-crd-docs' and commit the updated file."
47+
exit 1
48+
fi

0 commit comments

Comments
 (0)