From 7ba9773e68ac726c012e6429f0b8e6640cc7192f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 3 Apr 2020 16:51:43 +0200 Subject: [PATCH] Make golangci-lint failures fatal :skull_and_crossbones: --- .github/workflows/lint.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ff8971658..95b428055 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -45,12 +45,11 @@ jobs: assert-nothing-changed go fmt ./... assert-nothing-changed go mod tidy - bin/golangci-lint run --out-format tab --issues-exit-code 0 | while read -r loc linter msg; do - line="${loc#*:}" - printf '::warning file=%s,line=%s,col=%s::%s\n' \ - "${loc%%:*}" "${line%%:*}" "${loc##*:}" \ - "[$linter] $msg" - done + while read -r file linter msg; do + IFS=: read -ra f <<<"$file" + printf '::error file=%s,line=%s,col=%s::%s\n' "${f[0]}" "${f[1]}" "${f[2]}" "[$linter] $msg" + STATUS=1 + done < <(bin/golangci-lint run --out-format tab) exit $STATUS