Skip to content

Commit 121ac7e

Browse files
committed
ci: add generated-changes-diff check
Fails a PR (including drafts) when it changes code that should have triggered make manifests/generate/fmt but the regenerated output was not committed. Modeled on kaapi's generated-changes-diff workflow, re-scoped to byoh's own Makefile targets (no helm/airgap/kamaji equivalents exist here). Known issue: controller-gen v0.14.0 fails to build under Go 1.26.2 on a fresh checkout (golang.org/x/tools@v0.16.1's tokeninternal package no longer compiles against token.FileSet's current internal layout), so this check will fail on every PR until that's fixed separately.
1 parent 8423fdd commit 121ac7e

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: generated-changes-diff
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
run:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v6
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install Go 1.26.2
20+
uses: actions/setup-go@v6
21+
with:
22+
go-version: 1.26.2
23+
24+
- name: Check that manifests and generated code have been committed
25+
run: |
26+
make manifests generate fmt
27+
git diff --exit-code && [ -z "$(git ls-files --others --exclude-standard)" ] || (echo "Generated files are out of date. Run 'make manifests generate fmt' locally and commit the result (including any newly generated files)." && exit 1)

0 commit comments

Comments
 (0)