mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-07 20:45:53 +08:00
41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
name: Lint
|
|
|
|
on: [push,pull_request,workflow_dispatch]
|
|
|
|
jobs:
|
|
golangci:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Go environment
|
|
uses: actions/setup-go@v2.1.3
|
|
with:
|
|
go-version: 1.17
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v2
|
|
with:
|
|
version: latest
|
|
|
|
- name: Tests
|
|
run: |
|
|
go test $(go list ./...)
|
|
|
|
- name: Commit back
|
|
if: ${{ github.repository_owner == 'Mrs4s' && !github.event.pull_request }}
|
|
continue-on-error: true
|
|
run: |
|
|
git config --local user.name 'github-actions[bot]'
|
|
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
|
git add --all
|
|
git commit -m "ci(chore): Fix stylings"
|
|
git push
|
|
|
|
- name: Suggester
|
|
if: ${{ github.event.pull_request }}
|
|
uses: reviewdog/action-suggester@v1
|
|
with:
|
|
tool_name: golangci-lint
|