diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 93046bbf..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: weekly - - - package-ecosystem: docker - directories: - - "**/*" - schedule: - interval: weekly diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index b4337344..00000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,27 +0,0 @@ -change: - - head-branch: ["^change/"] - -enhancement: - - head-branch: ["^feature/", "^feat/", "^enhancement/", "^enh/"] - -bug: - - head-branch: ["^fix/", "^bug/"] - -chore: - - head-branch: ["^chore/"] - -tests: - - head-branch: ["^tests/", "^test/"] - - changed-files: - - any-glob-to-any-file: "tests/**/*" - -documentation: - - head-branch: ["^docs/", "^doc/"] - - changed-files: - - any-glob-to-any-file: "**/*.md" - -dependencies: - - head-branch: - ["^deps/", "^dep/", "^dependabot/", "pre-commit-ci-update-config"] - - changed-files: - - any-glob-to-any-file: ["go.mod", "go.sum"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ee1329e..90469a8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0 with: - version: latest + version: v2.2.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml deleted file mode 100644 index b56c3995..00000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Dependabot auto-merge - -on: pull_request_target - -permissions: - contents: read - -jobs: - dependabot: - runs-on: ubuntu-22.04 - permissions: - pull-requests: write - contents: write - if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} - steps: - - name: Dependabot metadata - id: dependabot-metadata - uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34 # v2.2.0 - - - name: Enable auto-merge for Dependabot PRs - run: gh pr merge --auto --squash "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{ secrets.NGINX_PAT }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index d62990da..e56a9a15 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -12,7 +12,15 @@ jobs: pull-requests: write # for actions/labeler to add labels runs-on: ubuntu-22.04 steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + sparse-checkout: | + labeler.yml + sparse-checkout-cone-mode: false + repository: nginxinc/k8s-common + - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true + configuration-path: labeler.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 79b9e3f0..6e52ecae 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,6 +31,8 @@ jobs: - name: Lint Go uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + with: + version: v1.60.1 # renovate: datasource=github-tags depName=golangci/golangci-lint actionlint: name: Actionlint diff --git a/.golangci.yml b/.golangci.yml index 8aa1bca2..3ec52004 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -32,17 +32,17 @@ linters-settings: linters: enable: - asasalint - - err113 - asciicheck - bidichk - contextcheck + - copyloopvar - dupword - durationcheck + - err113 - errcheck - errchkjson - errname - errorlint - - exportloopref - fatcontext - forcetypeassert - gocheckcompilerdirectives diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0eb6329..03036433 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,12 +11,17 @@ repos: - id: check-added-large-files - id: check-merge-conflict - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs - id: check-case-conflict - id: check-vcs-permalinks + - id: check-json + - id: pretty-format-json + args: [--autofix, --no-ensure-ascii] - id: mixed-line-ending args: [--fix=lf] - id: no-commit-to-branch - id: fix-byte-order-marker + - id: detect-private-key - repo: https://github.com/golangci/golangci-lint rev: v1.60.3 @@ -46,3 +51,4 @@ repos: ci: skip: [golangci-lint-full] + autoupdate_schedule: quarterly # We use renovate for more frequent updates and there's no way to disable autoupdate diff --git a/Makefile b/Makefile index 1c61ea77..d514c33d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ +# renovate: datasource=github-tags depName=golangci/golangci-lint +GOLANGCI_LINT_VERSION = v1.60.1 + test: unit-test test-integration test-integration-no-stream-block clean lint: - docker run --pull always --rm -v $(shell pwd):/nginx-plus-go-client -w /nginx-plus-go-client -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:latest golangci-lint --color always run + docker run --pull always --rm -v $(shell pwd):/nginx-plus-go-client -w /nginx-plus-go-client -v $(shell go env GOCACHE):/cache/go -e GOCACHE=/cache/go -e GOLANGCI_LINT_CACHE=/cache/go -v $(shell go env GOPATH)/pkg:/go/pkg golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) golangci-lint --color always run unit-test: go test -v -shuffle=on -race client/*.go diff --git a/renovate.json b/renovate.json index 01924e33..8bf65f91 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,7 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "github>nginxinc/k8s-common" - ] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>nginxinc/k8s-common", + "schedule:earlyMondays" + ] }