diff --git a/.github/workflows/md-html-deploy.yml b/.github/workflows/md-html-deploy.yml
index 7c3b05c..7ff9bca 100644
--- a/.github/workflows/md-html-deploy.yml
+++ b/.github/workflows/md-html-deploy.yml
@@ -48,12 +48,14 @@ jobs:
# Configure Git with a bot email and name
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- # Stash any unstaged changes
- git stash
- # Pull the latest changes from the remote branch with rebase
- git pull origin ${{ github.ref }} --rebase
- # Apply the stashed changes
- git stash pop
+ # Check for local changes and stash them if present
+ if [ -n "$(git status --porcelain)" ]; then
+ git stash
+ git pull origin ${{ github.ref }} --rebase
+ git stash pop
+ else
+ git pull origin ${{ github.ref }} --rebase
+ fi
# Add all changes, including untracked files
git add -A
# Commit the changes