From a6945249f8ee805e00683ad50accbeb273df46ea Mon Sep 17 00:00:00 2001 From: Julio Guerra Date: Wed, 14 Dec 2022 23:35:23 +0100 Subject: [PATCH] ci/govulncheck: fix and simplify the bash script (#1623) The bash script is always failing due to a mistake. To avoid it and make this CI more useful, we instead let govulncheck report its exit code along with its detailed output to make this workflow directly usable. --- .github/workflows/govulncheck.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 5a9cce925b..5119020fa6 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -5,6 +5,8 @@ on: - main schedule: - cron: '00 00 * * *' + workflow_dispatch: + jobs: govulncheck-tests: runs-on: ubuntu-latest @@ -20,18 +22,4 @@ jobs: run: | go install golang.org/x/vuln/cmd/govulncheck@latest - name: Run govulncheck - id: results - run: | - function check_results { - results=$(govulncheck $path | grep -Eo '\w+-\d+-\d+' | uniq) - num=$(echo $results | wc -l) - if [ $num -gt 0 ]; then - echo "Found $num vulnerabilities in $path. Run 'govulncheck $path' to find out more" | tee $GITHUB_STEP_SUMMARY - found=$(( found | 1)) - fi - } - path=./ddtrace/... check_results - path=./appsec/... check_results - path=./internal/... check_results - path=./profiler/... check_results - exit $found + run: govulncheck -v -tags appsec ./ddtrace/... ./appsec/... ./profiler/... ./internal/...