1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

ci: add goimports auto style fix

This commit is contained in:
wfjsw 2021-02-13 01:27:17 +08:00
parent 9f1cf68e0e
commit 4146a830b5

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

@ -0,0 +1,41 @@
name: Goimports Style Fix
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [ opened, synchronize ]
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 .