ci: address golangci-lint issue with persist-credentials (#16861)

* ci: address golangci-lint issue with persist-credentials

Fixes the following zizmor warning:

```
warning[artipacked]: credential persistence through GitHub Actions artifacts
  --> scripts/golangci-lint.yml:26:9
   |
26 |         - name: Checkout repository
   |  _________-
27 | |         uses: actions/checkout@11bd71901b # v4.2.2
28 | |         # with:
29 | |         #   persist-credentials: false
   | |______________________________________- does not set persist-credentials: false
```

All other actions have been fixed in https://github.com/prometheus/prometheus/pull/16530

Credit to @jharvey10 who also addressed this particular issue in
a5bf67d897

Signed-off-by: Cristian Greco <cristian@regolo.cc>

* update golangci-lint to v2.2.1

Signed-off-by: Cristian Greco <cristian@regolo.cc>

---------

Signed-off-by: Cristian Greco <cristian@regolo.cc>
This commit is contained in:
Cristian Greco 2025-07-11 11:53:32 +02:00 committed by GitHub
parent 63980e763e
commit 3a5db2d442
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -231,7 +231,7 @@ jobs:
with:
args: --verbose
# Make sure to sync this with Makefile.common and scripts/golangci-lint.yml.
version: v2.1.5
version: v2.2.1
fuzzing:
uses: ./.github/workflows/fuzzing.yml
if: github.event_name == 'pull_request'

View File

@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v2.1.5
GOLANGCI_LINT_VERSION ?= v2.2.1
GOLANGCI_FMT_OPTS ?=
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
# windows isn't included here because of the path separator being different.

View File

@ -25,6 +25,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
with:
@ -36,4 +38,4 @@ jobs:
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
args: --verbose
version: v2.1.5
version: v2.2.1