Skip to content

Commit ad2bc0d

Browse files
committed
fix: Handle divergent branches in deployment workflow
Replace 'git pull' with 'git fetch + git reset --hard' to ensure deployment always syncs to remote main branch, even when local repo has divergent commits.
1 parent 4a3f145 commit ad2bc0d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ jobs:
2323
# Navigate to repository
2424
cd /root/EasyAppDev.Blazor.AutoComplete
2525
26-
# Pull latest changes
27-
echo "[$(date)] Pulling latest changes..."
28-
git pull origin main
26+
# Fetch and reset to remote main (handles divergent branches)
27+
echo "[$(date)] Fetching and resetting to remote main..."
28+
git fetch origin main
29+
git reset --hard origin/main
2930
3031
# Publish the application
3132
echo "[$(date)] Publishing application..."

0 commit comments

Comments
 (0)