Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from Szzrain/ci/review_dog
Browse files Browse the repository at this point in the history
ci: add perms
  • Loading branch information
Szzrain authored Oct 19, 2024
2 parents 182fcc6 + c781045 commit fb23ed9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,39 @@ on:
- '**.go'
- 'go.mod'
- '.github/workflows/reviewdog.yml'
pull_request:
pull_request_target:
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/reviewdog.yml'

jobs:
review-dog:
permissions:
checks: write
contents: read
pull-requests: write
name: Review Dog
runs-on: ubuntu-latest
steps:
- name: Code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- run: go get
- run: go generate ./...

- name: GolangCI-Lint with review-dog
uses: reviewdog/action-golangci-lint@v2
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEW_DOG_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REVIEW_DOG_TOKEN }}
- name: Set Up Golint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
- uses: reviewdog/action-setup@v1
with:
tool_name: 'golangci-lint'
level: 'warning'
reporter: 'github-pr-review'
golangci_lint_version: 'v1.61.0'
go_version: '1.22'
cache: false
reviewdog_version: latest
- name: Run golang-ci & reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
golangci-lint run | reviewdog -reporter=github-pr-review -f=golangci-lint
10 changes: 10 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# reviewdog.yml
runner:
golint-by-project-conf:
cmd: golint $(go list ./... | grep -v /vendor/)
format: golint
level: warning
govet-by-project-conf:
cmd: go vet
format: govet
level: error
1 change: 1 addition & 0 deletions dice/platform_adapter_gocq.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ func (pa *PlatformAdapterGocq) Serve() int {

if len(m2) == len(items) {
ok := true
//test if i can trigger the review dog

Check failure on line 701 in dice/platform_adapter_gocq.go

View workflow job for this annotation

GitHub Actions / Test & Lint

commentFormatting: put a space between `//` and comment text (gocritic)
for i := range len(m2) {

Check failure on line 702 in dice/platform_adapter_gocq.go

View workflow job for this annotation

GitHub Actions / Test & Lint

for loop can be changed to `i := range m2` (intrange)
if m2[i] != items[i] {
ok = false
Expand Down

0 comments on commit fb23ed9

Please sign in to comment.