-
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1017 Bytes
/
lint-code.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-code
on:
push:
branches:
- main
pull_request:
types: [opened, edited, reopened, ready_for_review]
pull_request_target:
types: [opened, edited, reopened, ready_for_review]
env:
GO_VERSION: "~1.22"
GO111MODULE: "on"
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: Allow write access to checks to allow the action to annotate code in the PR.
checks: write
jobs:
run-golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Lint project code
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m --out-format=github-actions
skip-save-cache: false