From fed96fd6a6430e9e3d8c4d73bc7d1fd97065a123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Fri, 14 Jun 2024 10:32:02 +0200 Subject: [PATCH] fixup, go mod tidy -diff not yet implemented --- .github/workflows/code-quality.yaml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml index 1c8e83a07ec..88389f7da67 100644 --- a/.github/workflows/code-quality.yaml +++ b/.github/workflows/code-quality.yaml @@ -35,10 +35,18 @@ jobs: if: "${{ !cancelled() }}" working-directory: components/notebook-controller - - run: go mod tidy --diff - if: "${{ !cancelled() }}" - working-directory: components/notebook-controller - + # https://github.com/golang/go/issues/27005 + - run: | + set -e + go mod tidy + if [[ $(git ls-files . -d -m -o --exclude-standard --full-name -v | tee modified.log | wc -l) -gt 0 ]]; then + echo "There are changed files:" + cat modified.log + git diff + exit 1 + fi + + # https://go.googlesource.com/vuln # https://github.com/golangci/golangci-lint/issues/3094 - run: | go install golang.org/x/vuln/cmd/govulncheck@latest @@ -72,10 +80,20 @@ jobs: if: "${{ !cancelled() }}" working-directory: components/odh-notebook-controller - - run: go mod tidy --diff + # https://github.com/golang/go/issues/27005 + - run: | + set -e + go mod tidy + if [[ $(git ls-files . -d -m -o --exclude-standard --full-name -v | tee modified.log | wc -l) -gt 0 ]]; then + echo "There are changed files:" + cat modified.log + git diff + exit 1 + fi if: "${{ !cancelled() }}" working-directory: components/odh-notebook-controller + # https://go.googlesource.com/vuln # https://github.com/golangci/golangci-lint/issues/3094 - run: | go install golang.org/x/vuln/cmd/govulncheck@latest