-
Notifications
You must be signed in to change notification settings - Fork 240
54 lines (47 loc) · 1.35 KB
/
golangci-lint.yml
File metadata and controls
54 lines (47 loc) · 1.35 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
47
48
49
50
51
52
53
54
name: golangci-lint
on:
push:
branches:
- main
- 'release-*'
- 'feature-*'
pull_request:
branches: "*"
permissions:
contents: read
jobs:
golangci:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
cache-dependency-path: |
**/go.mod
**/go.sum
- name: Switch Dubbo-go version
run: |
# Acquire information of branch
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
BRANCH=${{github.base_ref}}
elif [ "$GITHUB_EVENT_NAME" == "push" ]; then
BRANCH=$GITHUB_REF_NAME
else
echo "$GITHUB_EVENT_NAME event is unsupported right now"
exit 1
fi
echo "EVENT = $GITHUB_EVENT_NAME, BRANCH = $BRANCH"
# Edit the version
go mod edit -replace=dubbo.apache.org/dubbo-go/v3=dubbo.apache.org/dubbo-go/v3@$BRANCH
go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
args: --timeout=10m