From 1b4e76797f2a9ba52f6d5db0c677f9ea30ecd4f6 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 18 Nov 2023 16:03:51 +0100 Subject: [PATCH] Add "go mod tidy" check to CI This should catch errors like this earlier. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5d5651ff..247dbe68b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,6 +131,10 @@ jobs: # ensure our vendor directory matches up with our go modules run: | go mod vendor && git diff --exit-code || (echo "Unexpected change to vendor directory. Run 'go mod vendor' locally and commit the changes" && exit 1) + - name: Check go.mod file + # ensure our go.mod file is clean + run: | + go mod tidy && git diff --exit-code || (echo "go.mod file is not clean. Run 'go mod tidy' locally and commit the changes" && exit 1) - name: Check All Auto-Generated Files # ensure all our auto-generated files are up to date run: |