-
Notifications
You must be signed in to change notification settings - Fork 21
50 lines (46 loc) · 1.43 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: go lint
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and
# should be specified with patch version.
version: v1.52.2
args: --timeout 5m --fix
github-token: ${{ secrets.github_token }}
# caching issues, see: https://github.com/golangci/golangci-lint-action/issues/244#issuecomment-1052190775
skip-pkg-cache: true
skip-build-cache: true
- name: go mod tidy
run: |
go mod tidy
if ! (test -z "$(git ls-files --exclude-standard --others .)$(git diff .)"); then
git ls-files --exclude-standard --others .
git diff .
echo "ERROR: 'go mod tidy' modified the source tree."
exit 1
fi
- name: make manifests
run: |
make manifests
if ! (test -z "$(git ls-files --exclude-standard --others .)$(git diff .)"); then
git ls-files --exclude-standard --others .
git diff .
echo "ERROR: 'make manifests' modified the source tree."
exit 1
fi