Skip to content

Commit

Permalink
Ensure we don't commit empty changes with dependabot generate (#645)
Browse files Browse the repository at this point in the history
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
  • Loading branch information
Danil-Grigorev committed Aug 7, 2024
1 parent 6bf4d7b commit 9903765
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

0 comments on commit 9903765

Please sign in to comment.