v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-29 05:50:17 -07:00

chore: add github workflows for auto format

This commit is contained in:
eeeXun 2023-01-10 03:12:07 +08:00
parent ddce44395d
commit 7d498399e1

36
.github/workflows/format.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: format
on:
push:
branches:
- master
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: Format with gofmt
run: go fmt .
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style(format): run gofmt"
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: Format with goimports
run: goimports -w .
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style(format): run goimports"