forked from ethpandaops/assertoor
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.21 KB
/
go-lint.yml
File metadata and controls
46 lines (38 loc) · 1.21 KB
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
name: Go lint Pipeline
on:
push:
branches:
- master
pull_request_target:
types: [synchronize]
workflow_dispatch:
jobs:
go-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go environment
uses: actions/setup-go@v2
with:
go-version: "1.24"
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s v2.1.6
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Run gofmt, golangci-lint, and staticcheck
run: |
chmod +x ./scripts/lint-go.sh
./scripts/lint-go.sh
- name: Commit and push fixes
run: |
# Check if there are any changes after gofmt or golangci-lint
git diff --exit-code || (
echo "There are changes, committing the fixes..." &&
git config user.name "github-actions" &&
git config user.email "github-actions@github.com" &&
git add . &&
git commit -m "Apply gofmt and golangci-lint fixes" &&
git push
)