Skip to content

Commit

Permalink
Updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dianashevchenko committed Dec 1, 2022
1 parent a804f5d commit 22bd20b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/govulncheck.sh
@@ -0,0 +1,6 @@
govulncheck $CHECK_DIR >> ddtrace_results.txt
if [ $(cat ddtrace_results.txt | grep "Vulnerability #" | wc -l) -gt 0 ]; then
echo "Found ${num} vulnerabilities"
echo $(cat ddtrace_results.txt | grep "Vulnerability #")
exit 1
fi
43 changes: 31 additions & 12 deletions .github/workflows/govulncheck.yml
Expand Up @@ -7,10 +7,8 @@ on:
# push:
# branches:
# - main
# tags:
# - "**"
# schedule:
# - cron: '00 04 * * 2-6'
# - cron: '00 00 * * *'
jobs:
govulncheck-tests:
runs-on: ubuntu-latest
Expand All @@ -22,17 +20,38 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: '1.18'
- name: Install and run govulncheck
- name: Install govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./ddtrace/...
- name: Comment results
run: |
num=$(govulncheck ./ddtrace/... | grep "Vulnerability #" | wc -l)
if [ $num -gt 0 ]; then
echo "Found ${num} vulnerabilities"
exit 1
fi
- name: Run govulncheck in ddtrace
env:
$CHECK_DIR: ./ddtrace/...
run: .github/workflows/govulncheck.sh
# run: |
# govulncheck ./ddtrace/... >> ddtrace_results.txt
# if [ $(cat ddtrace_results.txt | grep "Vulnerability #" | wc -l) -gt 0 ]; then
# echo "Found ${num} vulnerabilities"
# echo $(cat ddtrace_results.txt | grep "Vulnerability #")
# exit 1
# fi
# - name: Run govulncheck in appsec
# if: always()
# run: |
# govulncheck ./ddtrace/... >> ddtrace_results.txt
# if [ $(cat ddtrace_results.txt | grep "Vulnerability #" | wc -l) -gt 0 ]; then
# echo "Found ${num} vulnerabilities"
# echo $(cat ddtrace_results.txt | grep "Vulnerability #")
# exit 1
# fi
# - name: Run govulncheck in appsec
# if: always()
# run: |
# govulncheck ./ddtrace/... >> ddtrace_results.txt
# if [ $(cat ddtrace_results.txt | grep "Vulnerability #" | wc -l) -gt 0 ]; then
# echo "Found ${num} vulnerabilities"
# echo $(cat ddtrace_results.txt | grep "Vulnerability #")
# exit 1
# fi



Expand Down

0 comments on commit 22bd20b

Please sign in to comment.