-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (27 loc) · 854 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
name: Lint
# Trigger the workflow on pull requests and direct pushes to any branch
on:
push:
pull_request:
jobs:
lint:
name: golangci-lint and staticcheck
runs-on: ubuntu-latest
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
- name: Clone the code
uses: actions/checkout@v4
- name: Run linter
uses: golangci/golangci-lint-action@v4
with:
version: v1.54
args: --timeout=2m --fix
- name: Run staticcheck
uses: dominikh/staticcheck-action@v1
with:
version: "latest"