From 786e31483f3cac5e137dcf03ac5f8835510bd471 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Wed, 28 Aug 2024 13:50:56 -0700 Subject: [PATCH] Remove dependabot and use labeler from common --- .github/dependabot.yml | 16 ------------ .github/labeler.yml | 27 --------------------- .github/workflows/ci.yml | 2 +- .github/workflows/dependabot-auto-merge.yml | 23 ------------------ .github/workflows/labeler.yml | 8 ++++++ .github/workflows/lint.yml | 2 ++ Makefile | 4 ++- renovate.json | 3 ++- 8 files changed, 16 insertions(+), 69 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/labeler.yml delete mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index cbb4af56..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - schedule: - interval: weekly - - - package-ecosystem: gomod - directory: / - schedule: - interval: weekly - - - package-ecosystem: docker - directory: /build - schedule: - interval: weekly diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index b299b3d9..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: "**/*_test.go" - -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 85083fee..fb4e0f6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,7 +179,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: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} ${{ github.event_name == 'pull_request' && '--single-target' || '' }} --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 4dbcf1a2..00000000 --- a/.github/workflows/dependabot-auto-merge.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Dependabot auto-merge -on: pull_request_target - -permissions: - contents: read - -jobs: - dependabot: - runs-on: ubuntu-22.04 - if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} - permissions: - pull-requests: write - contents: write - 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 c2101085..9cda1a2c 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -12,7 +12,15 @@ jobs: pull-requests: write 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 5da00339..ca0c338b 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.3 # renovate: datasource=github-tags depName=golangci/golangci-lint actionlint: name: Actionlint diff --git a/Makefile b/Makefile index 8b4bf696..2c8e614c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ VERSION = 1.3.0 TAG = $(VERSION) PREFIX = nginx/nginx-prometheus-exporter +# renovate: datasource=docker depName=golangci/golangci-lint +GOLANGCI_LINT_VERSION = v1.60.3 .DEFAULT_GOAL:=nginx-prometheus-exporter @@ -19,7 +21,7 @@ build-goreleaser: ## Build all binaries using GoReleaser .PHONY: lint lint: ## Run linter - docker run --pull always --rm -v $(shell pwd):/nginx-prometheus-exporter -w /nginx-prometheus-exporter -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-prometheus-exporter -w /nginx-prometheus-exporter -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 .PHONY: test test: ## Run tests diff --git a/renovate.json b/renovate.json index a436d666..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" + "github>nginxinc/k8s-common", + "schedule:earlyMondays" ] }