chore: make lint happy #68
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: [push,pull_request,workflow_dispatch] | |
jobs: | |
golangci: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.20' | |
cache: false | |
- name: Sort imports | |
run: | | |
export PATH="$PATH:$GOPATH/bin" | |
go install -v github.com/incu6us/goimports-reviser/v3@latest | |
goimports-reviser -imports-order std,blanked,general,company,project -recursive ./.. | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
skip-cache: true | |
- name: Tests | |
run: | | |
go test $(go list ./...) | |
- name: Commit back | |
if: ${{ github.repository_owner == 'LagrangeDev' && !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: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tool_name: golangci-lint |