diff --git a/.gitea/workflows/render-md-to-html.yaml b/.gitea/workflows/render-md-to-html.yaml
index af1e8ab..7bc174a 100644
--- a/.gitea/workflows/render-md-to-html.yaml
+++ b/.gitea/workflows/render-md-to-html.yaml
@@ -141,16 +141,27 @@ jobs:
-o "${out}"
done
- #- name: Sync with remote before commit to avoid Job Race Conditions.
- # shell: bash
- # env:
- # GIT_SSH_COMMAND: "ssh -p 42842"
- # run: |
- # export GNUPGHOME="$(pwd)/.gnupg"
- # git fetch origin master
- # git rebase origin/master
- # git status
- # git log --oneline -n 5
+ - name: Sync with remote before commit to avoid Job Race Conditions.
+ shell: bash
+ env:
+ GIT_SSH_COMMAND: "ssh -p 42842"
+ run: |
+ set -euo pipefail
+ export GNUPGHOME="$(pwd)/.gnupg"
+
+ echo "đ Stashing local changes (if any) ..."
+ git stash push --include-untracked --message "pre-rebase stash" || true
+
+ echo "đ Fetching and rebasing from origin/master ..."
+ git fetch origin master
+ git rebase origin/master
+
+ echo "đ¯ Restoring local changes from stash (if any) ..."
+ git stash pop || echo "âšī¸ Nothing to pop or merge conflict during stash pop."
+
+ echo "đ Current status after rebase : "
+ git status
+ git log --oneline -n 5
- name: Stage generated files.
shell: bash