Skip to content

ci: Add govulncheck check #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,18 @@ jobs:
run: |
devbox run -- \
kind delete cluster --name chart-testing || true

govulncheck:
runs-on: ubuntu-22.04
strategy:
matrix:
module: [api, common, .]
steps:
- name: Check out code
uses: actions/checkout@v4

- id: govulncheck
uses: golang/govulncheck-action@v1
with:
work-dir: ${{ matrix.module }}
go-version-file: go.mod
1 change: 1 addition & 0 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"golines@latest",
"goreleaser@latest",
"gotestsum@latest",
"govulncheck@latest",
"helm-docs@latest",
"hugo@latest",
"kind@latest",
Expand Down
48 changes: 48 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,54 @@
}
}
},
"govulncheck@latest": {
"last_modified": "2024-03-08T13:51:52Z",
"resolved": "github:NixOS/nixpkgs/a343533bccc62400e8a9560423486a3b6c11a23b#govulncheck",
"source": "devbox-search",
"version": "1.0.4",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/kcqx91mgrw03wgqzzx96xprfjzkkss96-govulncheck-1.0.4",
"default": true
}
],
"store_path": "/nix/store/kcqx91mgrw03wgqzzx96xprfjzkkss96-govulncheck-1.0.4"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/4m6afbm7qm1rq5ql9a0x4xcyzlj5i627-govulncheck-1.0.4",
"default": true
}
],
"store_path": "/nix/store/4m6afbm7qm1rq5ql9a0x4xcyzlj5i627-govulncheck-1.0.4"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/nx4dsdypvbvizasrgjhpv82kw0fjlgm4-govulncheck-1.0.4",
"default": true
}
],
"store_path": "/nix/store/nx4dsdypvbvizasrgjhpv82kw0fjlgm4-govulncheck-1.0.4"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/kp3rjfdaxjx0m021nxp0kng5xx26p2j5-govulncheck-1.0.4",
"default": true
}
],
"store_path": "/nix/store/kp3rjfdaxjx0m021nxp0kng5xx26p2j5-govulncheck-1.0.4"
}
}
},
"helm-docs@latest": {
"last_modified": "2024-03-08T13:51:52Z",
"resolved": "github:NixOS/nixpkgs/a343533bccc62400e8a9560423486a3b6c11a23b#helm-docs",
Expand Down
14 changes: 14 additions & 0 deletions make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,17 @@ go-generate: ; $(info $(M) running go generate)
go-mod-upgrade: ## Interactive check for direct module dependency upgrades
go-mod-upgrade: ; $(info $(M) checking for direct module dependency upgrades)
go-mod-upgrade

.PHONY: govulncheck
govulncheck: ## Runs go fix for all modules in repository
ifneq ($(wildcard $(REPO_ROOT)/go.mod),)
govulncheck: govulncheck.root
endif
ifneq ($(words $(GO_SUBMODULES_NO_DOCS)),0)
govulncheck: $(addprefix govulncheck.,$(GO_SUBMODULES_NO_DOCS:/go.mod=))
endif

.PHONY: ggovulncheck.%
govulncheck.%: ## Runs golangci-lint for a specific module
govulncheck.%: ; $(info $(M) running govulncheck on $* module)
$(if $(filter-out root,$*),cd $* && )govulncheck ./...