Skip to content

Commit

Permalink
exit 0 if nothing to do
Browse files Browse the repository at this point in the history
  • Loading branch information
brown9804 authored Jan 13, 2025
1 parent b84df90 commit 928ad9b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/md-html-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ jobs:
fi
# Add all changes, including untracked files
git add -A
# Commit the changes
git commit -m 'Deploy static HTML files'
# Push the changes to the remote branch
git push origin HEAD:${{ github.ref }}
# Check for changes before committing
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
exit 0
else
# Commit the changes
git commit -m 'Deploy static HTML files'
# Push the changes to the remote branch
git push origin HEAD:${{ github.ref }}
fi

0 comments on commit 928ad9b

Please sign in to comment.