From 67258a2315b931d87aad629f415723579f23b5f0 Mon Sep 17 00:00:00 2001 From: Medzik <87065584+MedzikUser@users.noreply.github.com> Date: Wed, 18 Aug 2021 17:11:40 +0000 Subject: [PATCH] workflows fix --- .github/workflows/auto-fix.yml | 36 +++++++++------------------------- .github/workflows/release.yml | 4 ++-- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/auto-fix.yml b/.github/workflows/auto-fix.yml index d58508f..3651a9e 100644 --- a/.github/workflows/auto-fix.yml +++ b/.github/workflows/auto-fix.yml @@ -18,44 +18,26 @@ jobs: with: go-version: 1.17 - - name: Mod Tidy - run: go mod tidy - - name: Commit + - 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: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} - gofmt: - needs: 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: gofmt - run: go fmt ./... - - name: Commit run: | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" + 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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 768537c..c3f6f93 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,8 +28,8 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Remove Local Changes - run: git stash -u + - name: Checkout + uses: actions/checkout@v2 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2