From 27b271d85b637aa3924a560f8bb58ef9dd91b120 Mon Sep 17 00:00:00 2001 From: pitercoding Date: Thu, 19 Nov 2026 18:52:01 +0100 Subject: [PATCH 1/3] build: add lint target to Makefile --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ab584d5..7d0dd44 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ BACKEND_DIR := backend BUILD_DIR := bin MAIN_PATH := ./cmd/api -.PHONY: all build run dev test test-race fmt vet clean help db db-stop db-logs db-psql db-reset migrate migrate-down migrate-status +.PHONY: all build run dev test test-race fmt vet lint clean help db db-stop db-logs db-psql db-reset migrate migrate-down migrate-status # Default target when running only 'make' all: help @@ -50,6 +50,10 @@ vet: ## Look for suspicious code (go vet) @echo "==> Running vet..." cd $(BACKEND_DIR) && go vet ./... +lint: ## Run golangci-lint (includes gosec) + @echo "==> Running golangci-lint..." + cd $(BACKEND_DIR) && golangci-lint run + clean: ## Remove build artifacts @echo "==> Cleaning artifacts..." rm -rf $(BACKEND_DIR)/$(BUILD_DIR) From 4e2ea3d85aa39d9208b0c2e14e198bcbaf4262b5 Mon Sep 17 00:00:00 2001 From: pitercoding Date: Thu, 19 Nov 2026 18:56:17 +0100 Subject: [PATCH 2/3] ci: add Dependabot for Go, GitHub Actions and Docker --- .github/dependabot.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..50143a3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,25 @@ +version: 2 +updates: + # Go modules (go.mod lives in backend/) + - package-ecosystem: "gomod" + directory: "/backend" + schedule: + interval: "weekly" + commit-message: + prefix: "build(deps)" + + # Actions used in .github/workflows + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci(deps)" + + # Base images in backend/Dockerfile (golang and distroless) + - package-ecosystem: "docker" + directory: "/backend" + schedule: + interval: "weekly" + commit-message: + prefix: "build(deps)" From e3aa2fdcc91b4fd19ce6fff629a7ffffac3abd0c Mon Sep 17 00:00:00 2001 From: pitercoding Date: Thu, 19 Nov 2026 18:58:54 +0100 Subject: [PATCH 3/3] ci(backend): build the API image and scan it with Trivy --- .github/workflows/ci-backend.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index a5d090f..e0b20b1 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -78,3 +78,22 @@ jobs: # "go run pkg@version" runs the tool without adding it to go.mod - name: govulncheck run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... + + image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # Build the same image the deploy will use. This alone proves the + # Dockerfile still works. + - name: Build the API image + run: docker build -t aktenlens-api:ci backend + + # Fail only on CRITICAL vulnerabilities that already have a fix. + - name: Scan the image with Trivy + uses: aquasecurity/trivy-action@v0.36.0 + with: + image-ref: aktenlens-api:ci + severity: CRITICAL + ignore-unfixed: true + exit-code: "1"