Skip to content

Commit

Permalink
ci: Run go mod tidy check on submodules
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zalimeni committed Nov 27, 2023
1 parent cc14ccf commit 5316676
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/reusable-check-go-mod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5316676

Please sign in to comment.