mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
ci: add goimports auto style fix
This commit is contained in:
parent
9f1cf68e0e
commit
4146a830b5
41
.github/workflows/goimports.yml
vendored
Normal file
41
.github/workflows/goimports.yml
vendored
Normal 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 .
|
Loading…
x
Reference in New Issue
Block a user