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:
@@ -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: |
|
||||||
|
|||||||
Reference in New Issue
Block a user