Skip to content

Commit 69e96f1

Browse files
ci: Add govulncheck workflow (tendermint#9903) (tendermint#9915)
* Add vulncheck target to Makefile Signed-off-by: Thane Thomson <connect@thanethomson.com> * ci: Add govulncheck workflow Signed-off-by: Thane Thomson <connect@thanethomson.com> Signed-off-by: Thane Thomson <connect@thanethomson.com> (cherry picked from commit 8b7ae93) Co-authored-by: Thane Thomson <connect@thanethomson.com>
1 parent 9e8ed70 commit 69e96f1

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/govulncheck.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check for Go vulnerabilities
2+
# Runs https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck to proactively
3+
# check for vulnerabilities in code packages if there were any changes made to
4+
# any Go code or dependencies.
5+
#
6+
# Run `make vulncheck` from the root of the repo to run this workflow locally.
7+
on:
8+
pull_request:
9+
push:
10+
branches:
11+
- main
12+
- release/**
13+
14+
jobs:
15+
govulncheck:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/setup-go@v3
19+
with:
20+
go-version: "1.18"
21+
- uses: actions/checkout@v3
22+
- uses: technote-space/get-diff-action@v6
23+
with:
24+
PATTERNS: |
25+
**/*.go
26+
go.mod
27+
go.sum
28+
Makefile
29+
- name: govulncheck
30+
run: make vulncheck
31+
if: "env.GIT_DIFF != ''"

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ lint:
203203
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run
204204
.PHONY: lint
205205

206+
vulncheck:
207+
@go run golang.org/x/vuln/cmd/govulncheck@latest ./...
208+
.PHONY: vulncheck
209+
206210
DESTINATION = ./index.html.md
207211

208212
###############################################################################

0 commit comments

Comments
 (0)