Skip to content

Commit

Permalink
Adding a nightly govulncheck workflow (#1599)
Browse files Browse the repository at this point in the history
  • Loading branch information
dianashevchenko committed Dec 6, 2022
1 parent aaf7d39 commit 9dfd1b5
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/govulncheck.yml
@@ -0,0 +1,38 @@
name: Nightly govulncheck
on:
push:
branches:
- main
schedule:
- cron: '00 00 * * *'
jobs:
govulncheck-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: 'DataDog/dd-trace-go'
- name: Checkout Go
uses: actions/setup-go@v3
with:
go-version: '1.18'
- name: Install govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Comment results
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" >> $GITHUB_STEP_SUMMARY
echo "Found $num vulnerabilities in $path. Run 'govulncheck $path' to find out more"
found=$(( found | 1))
fi
}
path=./ddtrace/... check_results
path=./appsec/... check_results
path=./internal/... check_results
path=./profiler/... check_results
exit $found

0 comments on commit 9dfd1b5

Please sign in to comment.