Skip to content

Commit

Permalink
ci: github action job format shouldn't fail when nothing is to commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rexlManu committed Feb 6, 2024
1 parent b376889 commit 9b88f11
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ jobs:
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "style: format code with spotless"
git push
# Check for changes
git diff --staged --quiet || {
# Commit and push if there are changes
git commit -m "style: format code with spotless"
git push
} || {
# This block executes if the git diff command above returns true (no changes)
echo "No changes to commit."
}
build:
name: Build
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9b88f11

Please sign in to comment.