Skip to content

Commit b476e85

Browse files
committed
fix: Update GitHub Actions workflow for better compatibility
- Replace golangci-lint-action with direct installation - Use specific version of golangci-lint (v1.55.2) to avoid dependency issues - Install and use reviewdog directly instead of using actions - Install misspell tool directly via Go - Fix file extraction errors related to honnef.co/go/tools package - Simplify linter configuration to essential linters only
1 parent 6b1ac39 commit b476e85

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

.github/workflows/reviewdog.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@ jobs:
1313
- name: Check out code
1414
uses: actions/checkout@v4
1515

16-
- name: golangci-lint
17-
uses: reviewdog/action-golangci-lint@v2
16+
- name: Set up Go
17+
uses: actions/setup-go@v4
1818
with:
19-
github_token: ${{ secrets.github_token }}
20-
golangci_lint_flags: "--config=.golangci.yml"
21-
reporter: github-pr-review
22-
fail_on_error: true
19+
go-version: '1.22'
20+
cache: true
21+
22+
- name: Install golangci-lint
23+
run: |
24+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
25+
26+
- name: Install reviewdog
27+
run: |
28+
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
29+
30+
- name: Run golangci-lint with reviewdog
31+
env:
32+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }}
33+
run: |
34+
$(go env GOPATH)/bin/golangci-lint run --no-config --disable-all --enable=gofmt,govet,errcheck | reviewdog -f=golangci-lint -reporter=github-pr-review -level=info
2335
2436
go-test:
2537
name: runner / go test
@@ -44,9 +56,19 @@ jobs:
4456
- name: Check out code
4557
uses: actions/checkout@v4
4658

47-
- name: misspell
48-
uses: reviewdog/action-misspell@v1
59+
- name: Set up Go
60+
uses: actions/setup-go@v4
4961
with:
50-
github_token: ${{ secrets.github_token }}
51-
reporter: github-pr-review
52-
locale: "US"
62+
go-version: '1.22'
63+
cache: true
64+
65+
- name: Install reviewdog and misspell
66+
run: |
67+
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
68+
go install github.com/client9/misspell/cmd/misspell@latest
69+
70+
- name: Run misspell with reviewdog
71+
env:
72+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }}
73+
run: |
74+
$(go env GOPATH)/bin/misspell -locale US . | $(go env GOPATH)/bin/reviewdog -f=misspell -reporter=github-pr-review -level=info

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ jobs:
3737
run: go mod download
3838

3939
- name: Run linter
40-
uses: golangci/golangci-lint-action@v3
41-
with:
42-
version: latest
43-
args: --timeout=5m
40+
run: |
41+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
42+
$(go env GOPATH)/bin/golangci-lint run --timeout=5m --no-config --disable-all --enable=gofmt,govet,errcheck
4443
4544
- name: Run tests
4645
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

0 commit comments

Comments
 (0)