Skip to content

Commit 4459662

Browse files
authored
Check for changes in generated files in GitHub workflow (#844)
Problem: If we forget to run make generate, the out-of-date code can be committed to the main branch. Solution: Add a step to the Checks and Variables job in the CI workflow that checks if the generated files have changed. If they have changed, the job will fail, and the PR will be blocked.
1 parent 73015f8 commit 4459662

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
- name: Check if go.mod and go.sum are up to date
5050
run: go mod tidy && git diff --exit-code -- go.mod go.sum
5151

52+
- name: Check if generated files are up to date
53+
run: make generate && git diff --exit-code
54+
5255
unit-tests:
5356
name: Unit Tests
5457
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)