Skip to content

Commit 72eeefb

Browse files
authored
feat(github-actions): add Go file change detection to golangci-lint workflow (#1794)
- Introduced a step to check for changes in Go files using dorny/paths-filter. - Conditional execution of the linting step based on the presence of Go file changes. This enhancement optimizes the CI process by only running linting when relevant files are modified, improving efficiency. Signed-off-by: Kemal Akkoyun <[email protected]>
1 parent f6c417a commit 72eeefb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/golangci-lint.yml

+9
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ jobs:
3232
- name: Install snmp_exporter/generator dependencies
3333
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
3434
if: github.repository == 'prometheus/snmp_exporter'
35+
- name: Check for Go file changes
36+
id: go-changes
37+
uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
38+
with:
39+
filters: |
40+
go:
41+
- '**/*.go'
42+
3543
- name: Lint
44+
if: steps.go-changes.outputs.go == 'true'
3645
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3746
with:
3847
args: --verbose

0 commit comments

Comments
 (0)