fix: 修正 CI 並發 fetch 導致 git ref 衝突

git pull 改為 flock + fetch + reset --hard:
- flock 防止兩次 CI 同時更新 ref 產生 race condition
- reset --hard 比 pull 更適合 CI 環境,不做 merge

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 03:00:57 +08:00
parent 8974a22584
commit 0160d72467
+2 -1
View File
@@ -12,7 +12,8 @@ jobs:
- name: Pull latest code - name: Pull latest code
run: | run: |
cd /root/myproject/CFDivePlatform cd /root/myproject/CFDivePlatform
git pull flock -w 30 /tmp/cfdive-deploy.lock git fetch origin
git reset --hard origin/master
- name: Install Composer dependencies - name: Install Composer dependencies
run: | run: |