diff --git a/.github/workflows/repo-hygiene.yaml b/.github/workflows/repo-hygiene.yaml index c8830f5d73..11389d7ce5 100644 --- a/.github/workflows/repo-hygiene.yaml +++ b/.github/workflows/repo-hygiene.yaml @@ -3,7 +3,7 @@ on: workflow_dispatch: push: branches: - - main + - master pull_request: schedule: # run once a day at midnight @@ -18,17 +18,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.40 - # Optional: working directory, useful for monorepos - # working-directory: somedir - - # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 - args: --timeout=5m - - # Optional: show only new issues if it's a pull request. The default value is `false`. + args: --timeout=5m only-new-issues: true diff --git a/Makefile b/Makefile index 2973beeff7..e9c7192843 100644 --- a/Makefile +++ b/Makefile @@ -468,7 +468,10 @@ PRETTYGOTEST := $(shell command -v gotest 2> /dev/null) LINT_PKG ?= . -lint: $(GOLANGCI_LINT) ## Fast lint +lint: $(GOLANGCI_LINT) ## Fast lint vs default branch showing only new issues + $(GOLANGCI_LINT) run --new-from-rev=master -v $(LINT_PKG)/... + +lint-old: $(GOLANGCI_LINT) ## Fast lint including previous issues $(GOLANGCI_LINT) run -v $(LINT_PKG)/... # run all tests diff --git a/README.md b/README.md index f1007af8c7..df16f57aaf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Microsoft Azure Container Networking -[![Build Status](https://msazure.visualstudio.com/One/_apis/build/status/Custom/Networking/ContainerNetworking/Azure.azure-container-networking?branchName=master)](https://msazure.visualstudio.com/One/_build/latest?definitionId=95007&branchName=master) [![Go Report Card](https://goreportcard.com/badge/github.com/Azure/azure-container-networking)](https://goreportcard.com/report/github.com/Azure/azure-container-networking) ![GitHub release](https://img.shields.io/github/release/Azure/azure-container-networking.svg) +[![Build Status](https://msazure.visualstudio.com/One/_apis/build/status/Custom/Networking/ContainerNetworking/Azure.azure-container-networking?branchName=master)](https://msazure.visualstudio.com/One/_build/latest?definitionId=95007&branchName=master) [![Go Report Card](https://goreportcard.com/badge/github.com/Azure/azure-container-networking)](https://goreportcard.com/report/github.com/Azure/azure-container-networking) [![golangci-lint](https://github.com/Azure/azure-container-networking/actions/workflows/repo-hygiene.yaml/badge.svg?event=schedule)](https://github.com/Azure/azure-container-networking/actions/workflows/repo-hygiene.yaml) ![GitHub release](https://img.shields.io/github/release/Azure/azure-container-networking.svg) | Azure Network Policy Manager Conformance | | | ----------- | ----------- |