Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a nightly govulncheck workflow (#1599)
- Loading branch information
1 parent
aaf7d39
commit 9dfd1b5
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |