Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CRD docs check #1649

31 changes: 31 additions & 0 deletions .github/workflows/controller-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,34 @@ jobs:
version: v1.61.0
working-directory: go/controller
args: --timeout=30m
verify-docs:
name: Verify docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: go/controller
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go/controller/go.mod
cache: true
- name: Download dependencies
run: go mod download
- name: Download tools
run: PATH=$PATH:$GOPATH/bin make --directory=.. tools
- name: Regenerate docs
run: PATH=$PATH:$GOPATH/bin make codegen-crd-docs
- name: Check git diff
run: |
git --no-pager diff

if [[ $(git --no-pager diff | head -c1 | wc -c) -ne 0 ]]; then
echo -e "\nCRD docs are outdated. Please run 'make codegen-crd-docs' and commit the changes."
exit 1;
else
echo -e "\nCRD docs are up-to-date."
fi
Loading