2023-03-30 02:04:37 -07:00
|
|
|
---
|
|
|
|
# This action is synced from https://github.com/prometheus/prometheus
|
|
|
|
name: golangci-lint
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- "go.sum"
|
|
|
|
- "go.mod"
|
|
|
|
- "**.go"
|
|
|
|
- "scripts/errcheck_excludes.txt"
|
|
|
|
- ".github/workflows/golangci-lint.yml"
|
|
|
|
- ".golangci.yml"
|
|
|
|
pull_request:
|
|
|
|
|
2023-12-13 11:30:06 -08:00
|
|
|
permissions: # added using https://github.com/step-security/secure-repo
|
|
|
|
contents: read
|
|
|
|
|
2023-03-30 02:04:37 -07:00
|
|
|
jobs:
|
|
|
|
golangci:
|
2023-12-13 11:30:06 -08:00
|
|
|
permissions:
|
|
|
|
contents: read # for actions/checkout to fetch code
|
|
|
|
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
|
2023-03-30 02:04:37 -07:00
|
|
|
name: lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-10-01 16:46:13 -07:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2024-05-28 01:06:08 -07:00
|
|
|
- name: Install Go
|
2024-11-01 16:39:48 -07:00
|
|
|
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
|
2023-03-30 02:04:37 -07:00
|
|
|
with:
|
2024-08-20 05:21:42 -07:00
|
|
|
go-version: 1.23.x
|
2023-03-30 02:04:37 -07:00
|
|
|
- name: Install snmp_exporter/generator dependencies
|
|
|
|
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
|
|
|
|
if: github.repository == 'prometheus/snmp_exporter'
|
|
|
|
- name: Lint
|
2024-11-01 16:39:39 -07:00
|
|
|
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
|
2023-03-30 02:04:37 -07:00
|
|
|
with:
|
2024-05-28 01:06:08 -07:00
|
|
|
args: --verbose
|
2024-08-21 09:55:28 -07:00
|
|
|
version: v1.60.2
|