1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-07 12:43:32 +08:00

Merge pull request #123 from wfjsw/ci-cd/auto-sort-imports

ci: add goimports auto style fix
This commit is contained in:
Mrs4s 2021-02-14 11:05:35 +08:00 committed by GitHub
commit 3ff079f72e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

38
.github/workflows/goimports.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Goimports Style Fix
on:
push:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Fix stylings
run: |
export PATH="$PATH:$GOPATH/bin"
GO111MODULE=off go get golang.org/x/tools/cmd/goimports
goimports -l -w ./
- name: Commit back
continue-on-error: true
run: |
git config --local user.name 'github-actions'
git config --local user.email 'github-actions@users.noreply.github.com'
git add --all
git commit -m "ci(chore): Fix stylings"
git push
# - name: Test
# run: go test -v .