Skip to content

Commit 9c9da7c

Browse files
authored
ci: Add govulncheck check (#461)
1 parent 71ca4a9 commit 9c9da7c

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

.github/workflows/checks.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,18 @@ jobs:
219219
run: |
220220
devbox run -- \
221221
kind delete cluster --name chart-testing || true
222+
223+
govulncheck:
224+
runs-on: ubuntu-22.04
225+
strategy:
226+
matrix:
227+
module: [api, common, .]
228+
steps:
229+
- name: Check out code
230+
uses: actions/checkout@v4
231+
232+
- id: govulncheck
233+
uses: golang/govulncheck-action@v1
234+
with:
235+
work-dir: ${{ matrix.module }}
236+
go-version-file: go.mod

devbox.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"golines@latest",
1717
"goreleaser@latest",
1818
"gotestsum@latest",
19+
"govulncheck@latest",
1920
"helm-docs@latest",
2021
"hugo@latest",
2122
"kind@latest",

devbox.lock

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,54 @@
909909
}
910910
}
911911
},
912+
"govulncheck@latest": {
913+
"last_modified": "2024-03-08T13:51:52Z",
914+
"resolved": "github:NixOS/nixpkgs/a343533bccc62400e8a9560423486a3b6c11a23b#govulncheck",
915+
"source": "devbox-search",
916+
"version": "1.0.4",
917+
"systems": {
918+
"aarch64-darwin": {
919+
"outputs": [
920+
{
921+
"name": "out",
922+
"path": "/nix/store/kcqx91mgrw03wgqzzx96xprfjzkkss96-govulncheck-1.0.4",
923+
"default": true
924+
}
925+
],
926+
"store_path": "/nix/store/kcqx91mgrw03wgqzzx96xprfjzkkss96-govulncheck-1.0.4"
927+
},
928+
"aarch64-linux": {
929+
"outputs": [
930+
{
931+
"name": "out",
932+
"path": "/nix/store/4m6afbm7qm1rq5ql9a0x4xcyzlj5i627-govulncheck-1.0.4",
933+
"default": true
934+
}
935+
],
936+
"store_path": "/nix/store/4m6afbm7qm1rq5ql9a0x4xcyzlj5i627-govulncheck-1.0.4"
937+
},
938+
"x86_64-darwin": {
939+
"outputs": [
940+
{
941+
"name": "out",
942+
"path": "/nix/store/nx4dsdypvbvizasrgjhpv82kw0fjlgm4-govulncheck-1.0.4",
943+
"default": true
944+
}
945+
],
946+
"store_path": "/nix/store/nx4dsdypvbvizasrgjhpv82kw0fjlgm4-govulncheck-1.0.4"
947+
},
948+
"x86_64-linux": {
949+
"outputs": [
950+
{
951+
"name": "out",
952+
"path": "/nix/store/kp3rjfdaxjx0m021nxp0kng5xx26p2j5-govulncheck-1.0.4",
953+
"default": true
954+
}
955+
],
956+
"store_path": "/nix/store/kp3rjfdaxjx0m021nxp0kng5xx26p2j5-govulncheck-1.0.4"
957+
}
958+
}
959+
},
912960
"helm-docs@latest": {
913961
"last_modified": "2024-03-08T13:51:52Z",
914962
"resolved": "github:NixOS/nixpkgs/a343533bccc62400e8a9560423486a3b6c11a23b#helm-docs",

make/go.mk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,17 @@ go-generate: ; $(info $(M) running go generate)
193193
go-mod-upgrade: ## Interactive check for direct module dependency upgrades
194194
go-mod-upgrade: ; $(info $(M) checking for direct module dependency upgrades)
195195
go-mod-upgrade
196+
197+
.PHONY: govulncheck
198+
govulncheck: ## Runs go fix for all modules in repository
199+
ifneq ($(wildcard $(REPO_ROOT)/go.mod),)
200+
govulncheck: govulncheck.root
201+
endif
202+
ifneq ($(words $(GO_SUBMODULES_NO_DOCS)),0)
203+
govulncheck: $(addprefix govulncheck.,$(GO_SUBMODULES_NO_DOCS:/go.mod=))
204+
endif
205+
206+
.PHONY: ggovulncheck.%
207+
govulncheck.%: ## Runs golangci-lint for a specific module
208+
govulncheck.%: ; $(info $(M) running govulncheck on $* module)
209+
$(if $(filter-out root,$*),cd $* && )govulncheck ./...

0 commit comments

Comments
 (0)