Skip to content

Commit 34694d5

Browse files
committed
CI:add go vulnerability detect
Signed-off-by: Sam Yuan <[email protected]>
1 parent 3a50596 commit 34694d5

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: go vulnerability detect
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
vulnerability_detect:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@main
11+
- uses: actions/setup-go@main
12+
with:
13+
go-version: 1.18
14+
- name: run vulnerability detect
15+
run: make govulncheck

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ test-verbose: ginkgo-set tidy-vendor
144144
escapes_detect: tidy-vendor
145145
@go build -tags $(GO_BUILD_TAGS) -gcflags="-m -l" ./... | grep "escapes to heap" || true
146146

147+
set_govulncheck:
148+
@go install golang.org/x/vuln/cmd/govulncheck@latest
149+
150+
govulncheck: set_govulncheck tidy-vendor
151+
@govulncheck -v ./... || true
152+
147153
format:
148154
gofmt -e -d -s -l -w pkg/ cmd/
149155

0 commit comments

Comments
 (0)