-
Notifications
You must be signed in to change notification settings - Fork 265
41 lines (37 loc) · 936 Bytes
/
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
name: lint
on: [push, pull_request]
permissions:
contents: read
pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
only-new-issues: true
tidy:
name: Remain 'go mod tidy'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Verify tidyness
run: |
go mod tidy
if ! git diff --quiet go.mod go.sum; then
echo "'go mod tidy' resulted in changes:"
git diff go.mod go.sum
echo "Please commit these changes."
fi