Skip to content

Commit

Permalink
add pipeline job to check auto generated docs are up to date
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies committed Feb 21, 2023
1 parent 4ec0fd1 commit 4b6aed8
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/markdown-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
paths:
- '**.md'

env:
GO_VERSION: "~1.19"

defaults:
run:
shell: bash
Expand Down Expand Up @@ -55,3 +58,35 @@ jobs:
- name: Lint Markdown files
run: make markdownlint

check-crd-docs:
name: Check CRD auto-generated docs
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Copy old docs
run: |
cp -R ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old
- name: Run docs generator
run: ./.github/scripts/generate-crd-docs/generate-crd-docs.sh

- name: Check if docs are up to date
run: |
if ! diff -rq ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old &>/dev/null; then
echo "The CRD docs have changes that are not reflected in the docs pages. Please use ./.github/scripts/generate-crd-docs/generate-crd-docs.sh to re-generate the docs."
echo ""
echo "=========== Diff ==========="
diff -ru ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old
exit 1
else
echo ""
echo "CRD docs are up to date!"
fi

0 comments on commit 4b6aed8

Please sign in to comment.