...
1---
2# This action is synced from https://github.com/prometheus/prometheus
3name: golangci-lint
4on:
5 push:
6 paths:
7 - "go.sum"
8 - "go.mod"
9 - "**.go"
10 - "scripts/errcheck_excludes.txt"
11 - ".github/workflows/golangci-lint.yml"
12 - ".golangci.yml"
13 pull_request:
14
15permissions: # added using https://github.com/step-security/secure-repo
16 contents: read
17
18jobs:
19 golangci:
20 permissions:
21 contents: read # for actions/checkout to fetch code
22 pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
23 name: lint
24 runs-on: ubuntu-latest
25 steps:
26 - name: Checkout repository
27 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28 - name: install Go
29 uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
30 with:
31 go-version: 1.20.x
32 - name: Install snmp_exporter/generator dependencies
33 run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
34 if: github.repository == 'prometheus/snmp_exporter'
35 - name: Lint
36 uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
37 with:
38 version: v1.54.2
View as plain text