From 75f1712ce1019ee3606fa20226b0ac55d6404c12 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 8 Oct 2019 12:13:13 +0100 Subject: [PATCH] Adapt for CI runs --- scripts/find-lint.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/find-lint.sh b/scripts/find-lint.sh index 8917e7abd..9370fcf54 100755 --- a/scripts/find-lint.sh +++ b/scripts/find-lint.sh @@ -29,10 +29,15 @@ echo "Installing golangci-lint..." cp go.mod go.mod.bak && cp go.sum go.sum.bak go get github.com/golangci/golangci-lint/cmd/golangci-lint -echo "Looking for lint..." # Run linting -# Ensure module files or moved back even if the linting command fails -golangci-lint run $args || echo "Linting execution failed..." +echo "Looking for lint..." +# If we're running in CI, a linting fail should fail the CI step +if [ -n "$CI" ]; then + golangci-lint run $args +else + # Otherwise continue the script even if linting fails + golangci-lint run $args || echo "Linting script failed, removing module backups" +fi # Restore go.{mod,sum} mv go.mod.bak go.mod && mv go.sum.bak go.sum