Skip to content

Commit 919a816

Browse files
Add GitHub Actions workflow to verify code generation
Introduce a workflow that runs code generation targets and detects any uncommitted changes. This ensures generated code, docs, charts, and formatting are always up to date in pull requests.
1 parent 34a3d0d commit 919a816

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Check Codegen
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
paths-ignore:
11+
- 'docs/**'
12+
- '**/*.md'
13+
14+
jobs:
15+
check-codegen:
16+
name: Detect Drift
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: actions/setup-go@v6
21+
with:
22+
go-version-file: 'go.mod'
23+
- name: Run make generate
24+
run: make generate
25+
- name: Run make docs
26+
run: make docs
27+
- name: Run make charts
28+
run: make charts
29+
- name: Run fmt
30+
run: make fmt
31+
- name: Compare the expected and actual generated/* directories
32+
run: |
33+
if [ "$(git diff | wc -l)" -gt "0" ]; then
34+
echo "Detected uncommitted changes after build. Consider running 'make generate && make docs && make charts && make fmt'."
35+
echo "See status below:"
36+
git diff
37+
exit 1
38+
fi

0 commit comments

Comments
 (0)