Skip to content

Commit

Permalink
Check for changes in generated files in GitHub workflow (#844)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kate-osborn authored Jul 11, 2023
1 parent 73015f8 commit 4459662
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
- name: Check if go.mod and go.sum are up to date
run: go mod tidy && git diff --exit-code -- go.mod go.sum

- name: Check if generated files are up to date
run: make generate && git diff --exit-code

unit-tests:
name: Unit Tests
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 4459662

Please sign in to comment.