- CORRECTED: Include both main and release-* branch patterns - Ensures workflows run on both main branch (original functionality) and release branches (needed for backport) - Previous commit incorrectly removed main branch support - Workflows updated: documentation-ci, pr-codeql-analysis-*, pr-dependabot-update-go-workspace, pr-go-workspace-check, pr-k8s-codegen-check, verify-kinds, codeowners-validator
42 lines
922 B
YAML
42 lines
922 B
YAML
name: "K8s Codegen Check"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches: [main, release-*]
|
|
paths:
|
|
- "pkg/apis/**"
|
|
- "pkg/aggregator/apis/**"
|
|
- "pkg/apimachinery/apis/**"
|
|
- "hack/**"
|
|
- "apps/**"
|
|
- "*.sum"
|
|
|
|
jobs:
|
|
check:
|
|
name: K8s Codegen Check
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set go version
|
|
uses: actions/setup-go@19bb51245e9c80abacb2e91cc42b33fa478b8639
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Update k8s codegen
|
|
run: ./hack/update-codegen.sh
|
|
|
|
- name: Check for k8s codegen changes
|
|
run: |
|
|
if ! git diff --exit-code --quiet; then
|
|
echo "Changes detected:"
|
|
git diff
|
|
echo "Please run './hack/update-codegen.sh' and commit the changes."
|
|
exit 1
|
|
fi
|