Skip to content

Commit 7ba9773

Browse files
committed
Make golangci-lint failures fatal ☠️
1 parent 734497a commit 7ba9773

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ jobs:
4545
assert-nothing-changed go fmt ./...
4646
assert-nothing-changed go mod tidy
4747
48-
bin/golangci-lint run --out-format tab --issues-exit-code 0 | while read -r loc linter msg; do
49-
line="${loc#*:}"
50-
printf '::warning file=%s,line=%s,col=%s::%s\n' \
51-
"${loc%%:*}" "${line%%:*}" "${loc##*:}" \
52-
"[$linter] $msg"
53-
done
48+
while read -r file linter msg; do
49+
IFS=: read -ra f <<<"$file"
50+
printf '::error file=%s,line=%s,col=%s::%s\n' "${f[0]}" "${f[1]}" "${f[2]}" "[$linter] $msg"
51+
STATUS=1
52+
done < <(bin/golangci-lint run --out-format tab)
5453
5554
exit $STATUS
5655

0 commit comments

Comments
 (0)