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 <ivan@vald.es>
This commit is contained in:
Ivan Valdes 2024-06-29 14:58:11 -07:00
parent 8fde09b634
commit 20f7988c1d
No known key found for this signature in database
GPG Key ID: 4037D37741ED0CC5

View File

@ -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 ./...'