2021-08-18 16:50:08 +00:00
|
|
|
name: auto fix
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tidy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.17
|
|
|
|
|
2021-08-18 17:11:40 +00:00
|
|
|
- name: Setup Git
|
2021-08-18 16:50:08 +00:00
|
|
|
run: |
|
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
2021-08-18 17:11:40 +00:00
|
|
|
|
|
|
|
- name: Mod Tidy
|
|
|
|
run: |
|
|
|
|
go mod tidy
|
2021-08-18 16:50:08 +00:00
|
|
|
git add .
|
|
|
|
git diff-index --quiet HEAD || git commit -m "go mod tidy"
|
|
|
|
|
|
|
|
- name: gofmt
|
|
|
|
run: |
|
2021-08-18 17:13:28 +00:00
|
|
|
go fmt ./...
|
2021-08-18 16:50:08 +00:00
|
|
|
git add .
|
|
|
|
git diff-index --quiet HEAD || git commit -m "gofmt"
|
|
|
|
|
2021-08-18 17:11:40 +00:00
|
|
|
- name: Pull changes
|
|
|
|
run: git pull -r
|
|
|
|
|
2021-08-18 16:50:08 +00:00
|
|
|
- name: Push changes
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|