Skip to content

Commit

Permalink
chore: use infra-checkers static analysis settings and include known …
Browse files Browse the repository at this point in the history
…issue to trivyignore (#52)
  • Loading branch information
sigilioso committed Aug 29, 2022
1 parent 46747b4 commit eaffa2e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 41 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/push_pr.yml
Expand Up @@ -19,13 +19,18 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: newrelic/newrelic-infra-checkers@v1
with:
golangci-lint-config: golangci-lint-limited
- name: Semgrep
uses: returntocorp/semgrep-action@v1
with:
auditOn: push
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
continue-on-error: ${{ github.event_name != 'pull_request' }}
with:
only-new-issues: true
Expand Down
29 changes: 0 additions & 29 deletions .golangci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .trivyignore
@@ -0,0 +1,3 @@
# We are running the 2.16.0 version of github.com/emicklei/go-restful that had the fix backported, but trivy still points it out as false-positive
# This is going to be fixed by 2.15 of the kubernetes client go, they decided not to backport the fix since they are not using the impacted feature.
CVE-2022-1996
13 changes: 2 additions & 11 deletions Makefile
Expand Up @@ -8,32 +8,23 @@ IMAGE_NAME ?= newrelic/nri-discovery-kubernetes
GOPATH := $(shell go env GOPATH)
GORELEASER_VERSION := v0.168.0
GORELEASER_BIN ?= bin/goreleaser
GOLANGCI_LINT_BIN = golangci-lint

all: build

build: check-version clean validate test compile
build: check-version clean test compile

clean:
@echo "=== $(PROJECT) === [ clean ]: Removing binaries and coverage file..."
@rm -rfv bin
@rm -rfv target

tools: check-version
@which $(GOLANGCI_LINT_BIN) || echo "golangci-lint not found in PATH" >&2 && exit 1

fmt:
@go fmt ./...

deps:
@echo "=== $(PROJECT) === [ deps ]: Installing package dependencies required by the project..."
@go mod download

validate: deps
@echo "=== $(PROJECT) === [ validate ]: Validating source code running golangci-lint..."
@${GOLANGCI_LINT_BIN} --version
@${GOLANGCI_LINT_BIN} run

compile: deps
@echo "=== $(PROJECT) === [ compile ]: Building $(BINARY_NAME)..."
@go build -o bin/$(BINARY_NAME) ./cmd/discovery/
Expand Down Expand Up @@ -71,4 +62,4 @@ endif
include $(CURDIR)/build/ci.mk
include $(CURDIR)/build/release.mk

.PHONY: all fmt build clean tools tools-update deps deps-only validate compile compile-only test check-version tools-golangci-lint docker-build release release/deps release/test docker-release
.PHONY: all fmt build clean tools tools-update deps deps-only compile compile-only test check-version docker-build release release/deps release/test snyk snyk/monitor docker-release

0 comments on commit eaffa2e

Please sign in to comment.