mirror of
https://github.com/MedzikUser/go-utils.git
synced 2024-08-15 03:26:56 +00:00
update workflows
This commit is contained in:
parent
b3c926d9d6
commit
7cc987e305
1 changed files with 45 additions and 0 deletions
45
.github/workflows/auto-fix.yml
vendored
Normal file
45
.github/workflows/auto-fix.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
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
|
||||
|
||||
- name: Setup Git
|
||||
run: |
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
|
||||
- name: Mod Tidy
|
||||
run: |
|
||||
go mod tidy
|
||||
git add .
|
||||
git diff-index --quiet HEAD || git commit -m "go mod tidy"
|
||||
|
||||
- name: gofmt
|
||||
run: |
|
||||
go fmt ./...
|
||||
git add .
|
||||
git diff-index --quiet HEAD || git commit -m "gofmt"
|
||||
|
||||
- name: Pull changes
|
||||
run: git pull -r
|
||||
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
Loading…
Reference in a new issue