diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db6260a9d18..4735969141b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: - name: go fmt if: matrix.os == 'macos-latest' - run: make fmt-go && git diff-index --quiet HEAD -- + run: make fmt-go - name: npm ci run: cd scripts && npm ci diff --git a/Makefile b/Makefile index 177a748cad6..8d7a11edc54 100644 --- a/Makefile +++ b/Makefile @@ -32,12 +32,7 @@ vet-go: go vet ./cmd/... ./internal/... ./pkg/... fmt-go: - # This uses "|| true" to swallow errors because for some reason this command - # started randomly failing when run inside GitHub Actions. It still formats - # all files successfully but then sometimes exits with a status of 1 (this - # started on April 14th, 2021). I don't know why this happens and don't know - # how to fix it. I'm just swallowing this error for now to move past this. - go fmt ./cmd/... ./internal/... ./pkg/... || true + test -z "$(shell go fmt ./cmd/... ./internal/... ./pkg/... )" no-filepath: @! grep --color --include '*.go' -r '"path/filepath"' cmd internal pkg || ( \