Skip to content
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

add make target for gosec #25

Merged
merged 4 commits into from
Jul 16, 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
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
Loading