Skip to content

Commit 0bce0e6

Browse files
committed
chore: account for all modules in go mod tidy check
This will do `go mod tidy` for each module. This came up recently when the updater/driver's go.mod and go.sum had become stale. Signed-off-by: crozzy <joseph.crosland@gmail.com>
1 parent 88f28c0 commit 0bce0e6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ jobs:
4848
- name: Go Tidy
4949
if: ${{ !cancelled() && steps.checkout.conclusion == 'success' && steps.setupgo.conclusion == 'success' }}
5050
run: |
51-
trap 'echo "::error file=go.mod,title=Tidy Check::Commit would leave go.mod untidy"' ERR
52-
go mod tidy
51+
trap 'echo "::error title=Tidy Check::Commit would leave go.mod/go.sum untidy"' ERR
52+
find . -name .git -prune -o -name testdata -prune -o -name vendor -prune -o -name go.mod -printf '%h\n' |
53+
while read -r dir; do (cd "$dir" && go mod tidy); done
5354
git diff --exit-code
5455
- name: Go Generate
5556
if: ${{ !cancelled() && steps.checkout.conclusion == 'success' && steps.setupgo.conclusion == 'success' }}

0 commit comments

Comments
 (0)