From 20f7988c1d4bfef9456243b0e1f7222077138727 Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Sat, 29 Jun 2024 14:58:11 -0700 Subject: [PATCH] github/govuln: don't swallow govulncheck errors By running `find -exec`, an error exit code doesn't properly return the error if there's a failure in a command executed. Use `xargs` to force an exit with error when a command fails to run. Signed-off-by: Ivan Valdes --- .github/workflows/govuln.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/govuln.yaml b/.github/workflows/govuln.yaml index 443a0eb6697..9ec94d1bab7 100644 --- a/.github/workflows/govuln.yaml +++ b/.github/workflows/govuln.yaml @@ -18,4 +18,4 @@ jobs: go install golang.org/x/vuln/cmd/govulncheck@latest - find -name go.mod -exec /bin/bash -c 'echo scanning $(dirname {}); govulncheck -C $(dirname {}) -show verbose ./...' \; + find . -name go.mod | xargs -I'{}' /bin/bash -c 'echo scanning $(dirname {}); govulncheck -C $(dirname {}) -show verbose ./...'