File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CRD Validation
2+
3+ on :
4+ pull_request :
5+ types : [opened, edited, synchronize, reopened]
6+
7+ permissions :
8+ contents : read
9+
10+ jobs :
11+ crd-validation :
12+ name : CRD Validation Check
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+ with :
18+ persist-credentials : false
19+ fetch-depth : 0
20+
21+ - name : Set up Go
22+ uses : actions/setup-go@v6
23+ with :
24+ go-version : " 1.25"
25+ cache : true
26+
27+ - name : Install crdify
28+ run : |
29+ go install sigs.k8s.io/crdify@latest
30+
31+ - name : Run CRD Validation Check
32+ run : |
33+ git fetch origin ${{ github.base_ref }}:upstream_base
34+ BASE_SHA=$(git rev-parse upstream_base)
35+
36+ FAILED=0
37+ for crd in config/crd/bases/*.yaml; do
38+ if ! crdify "git://${BASE_SHA}?path=$crd" "git://HEAD?path=$crd"; then
39+ echo "❌ Incompatible change detected in $crd"
40+ ((FAILED++))
41+ else
42+ echo "✅ $crd is valid"
43+ fi
44+ done
45+
46+ if [ "$FAILED" -gt 0 ]; then
47+ echo "::error::Validation failed! Found $FAILED incompatible CRD change(s)."
48+ exit 1
49+ fi
50+
51+ echo "All CRDs are compatible."
You can’t perform that action at this time.
0 commit comments