Skip to content

Commit 14e247c

Browse files
committed
Update common Prometheus files
Signed-off-by: prombot <[email protected]>
1 parent a6ebb3e commit 14e247c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2828
with:
2929
persist-credentials: false
3030
- name: Install Go
31-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
31+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
3232
with:
3333
go-version: 1.25.x
3434
- name: Install snmp_exporter/generator dependencies
@@ -38,7 +38,7 @@ jobs:
3838
id: golangci-lint-version
3939
run: echo "version=$(make print-golangci-lint-version)" >> $GITHUB_OUTPUT
4040
- name: Lint
41-
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
41+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
4242
with:
4343
args: --verbose
4444
version: ${{ steps.golangci-lint-version.outputs.version }}

Makefile.common

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 The Prometheus Authors
1+
# Copyright The Prometheus Authors
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT :=
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v2.6.0
64+
GOLANGCI_LINT_VERSION ?= v2.7.2
6565
GOLANGCI_FMT_OPTS ?=
6666
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
6767
# windows isn't included here because of the path separator being different.
@@ -129,6 +129,12 @@ common-check_license:
129129
echo "license header checking failed:"; echo "$${licRes}"; \
130130
exit 1; \
131131
fi
132+
@echo ">> checking for copyright years 2026 or later"
133+
@futureYearRes=$$(git grep -E 'Copyright (202[6-9]|20[3-9][0-9])' -- '*.go' ':!:vendor/*' || true); \
134+
if [ -n "$${futureYearRes}" ]; then \
135+
echo "Files with copyright year 2026 or later found (should use 'Copyright The Prometheus Authors'):"; echo "$${futureYearRes}"; \
136+
exit 1; \
137+
fi
132138

133139
.PHONY: common-deps
134140
common-deps:

0 commit comments

Comments
 (0)