From 0ab0b35127f10d9439132e5c2f5a9a4037d7e289 Mon Sep 17 00:00:00 2001 From: Timna Brown <24630902+brown9804@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:33:58 -0600 Subject: [PATCH] Update md-html-deploy.yml --- .github/workflows/md-html-deploy.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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