Skip to content

Commit

Permalink
Merge pull request #25 from hyperspike/gosec
Browse files Browse the repository at this point in the history
add make target for gosec
  • Loading branch information
dmolik authored Jul 16, 2024
2 parents 61614b0 + ddf1746 commit 951f2cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Scan
# Run workflow each time code is pushed to your repository and on a schedule.
# The scheduled workflow runs every at 00:00 on Sunday UTC time.
on:
push:
branches:
- main
pull_request:

jobs:
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,16 @@ test: manifests generate fmt vet envtest ## Run tests.
test-e2e:
$Q$(GO) test ./test/e2e/ -v -ginkgo.v

.PHONY: lint
.PHONY: lint lint-fix
lint: golangci-lint ## Run golangci-lint linter
$Q$(GOLANGCI_LINT) run

.PHONY: lint-fix
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
$Q$(GOLANGCI_LINT) run --fix

gosec: ## Run gosec for static security scanning
$Q$(GOSEC) ./...

##@ Build

manager: manifests generate fmt vet ## Build manager binary.
Expand Down Expand Up @@ -189,6 +191,7 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
GOSEC := $(shell which gosec)

## Tool Versions
KUSTOMIZE_VERSION ?= v5.4.1
Expand Down
2 changes: 0 additions & 2 deletions internal/controller/gitea_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ func init() {
}
}

var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

func randString(n int) (string, error) {
const letters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"
ret := make([]byte, n)
Expand Down

0 comments on commit 951f2cd

Please sign in to comment.