From 99037655c9e9945929842feffa1bd158a8e33932 Mon Sep 17 00:00:00 2001 From: Danil Grigorev Date: Wed, 7 Aug 2024 09:02:06 +0200 Subject: [PATCH] Ensure we don't commit empty changes with dependabot generate (#645) Signed-off-by: Danil-Grigorev --- .github/workflows/dependabot.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 8f45500e..6740c63a 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -17,8 +17,6 @@ jobs: build: name: Build runs-on: ubuntu-latest - outputs: - output1: ${{ steps.check_changes.outputs.CHANGES }} steps: - name: Set up Go 1.x uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # tag=v3.5.0 @@ -27,20 +25,11 @@ jobs: id: go - name: Check out code into the Go module directory uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # tag=v4.1.3 - - name: Check for changes - id: check_changes - run: | - if git diff --quiet; then - echo "CHANGES=false" >> "$GITHUB_OUTPUT" - else - echo "CHANGES=true" >> "$GITHUB_OUTPUT" - fi - name: Update generated code run: make generate - name: Commit changes - if: steps.check_changes.outputs.CHANGES == 'true' run: | git config --local user.email "49699333+dependabot[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" git add . - git commit -m "Update generated code" + [[ -z "$(git status -s)" ]] || git commit -m "Update generated code"