grafana/.github/workflows/pr-k8s-codegen-check.yml
2024-08-14 11:06:37 -04:00

38 lines
807 B
YAML

name: "K8s Codegen Check"
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- "pkg/apis/**"
- "pkg/aggregator/apis/**"
- "pkg/apimachinery/apis/**"
- "hack/**"
- "*.sum"
jobs:
check:
name: K8s Codegen Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set go version
uses: actions/setup-go@v4
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