ci: Run `go mod tidy` check on submodules (#19744)

Today, we do not enforce a clean `go mod tidy` on submodules. This
allows for drift and can eventually lead to `golangci-lint` failures,
along with the obvious disadvantage of not having an up-to-date
`go.mod`.

Enforce clean `go mod tidy` on all `go.mod` by using our make target
rather than the direct root-level command.
This commit is contained in:
Michael Zalimeni 2023-11-27 16:28:35 -05:00 committed by GitHub
parent af27121fcc
commit 2732376449
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,8 @@ jobs:
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: 'go.mod'
- run: go mod tidy
# Run on all go.mod (include submodules).
- run: make go-mod-tidy
- run: |
if [[ -n $(git status -s) ]]; then
echo "Git directory has changes"