fix(runner): 保留 _runner_file_commands 避免 checkout 失敗

問題: 清理腳本刪除了 $RUNNER_TEMP/* 包含 _runner_file_commands
結果: "Missing file at path: _runner_file_commands/set_output_xxx"

修正:
- 移除 rm -rf $RUNNER_TEMP/* (會刪除關鍵檔案)
- Pre-flight: 使用 find 排除 _runner_file_commands
- 其他 Jobs: 只清理 _diag/pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-29 02:07:05 +08:00
parent 93c3280481
commit 02c38c3a9b

View File

@@ -88,9 +88,10 @@ jobs:
echo " ✅ Cleaned _diag/pages"
fi
# 2. 清理 RUNNER_TEMP
rm -rf "$RUNNER_TEMP"/* 2>/dev/null
echo " ✅ Cleaned RUNNER_TEMP"
# 2. 清理 RUNNER_TEMP (排除 _runner_file_commands)
# 注意: 不能刪除整個目錄,否則會破壞 Runner 內部通訊
find "$RUNNER_TEMP" -mindepth 1 -maxdepth 1 ! -name "_runner_file_commands" -exec rm -rf {} \; 2>/dev/null || true
echo " ✅ Cleaned RUNNER_TEMP (preserved _runner_file_commands)"
# 3. 清理 Claude worktrees
rm -rf .claude/worktrees 2>/dev/null
@@ -161,10 +162,11 @@ jobs:
k3s-system: ${{ steps.filter.outputs.k3s-system }}
steps:
# 2026-03-29: Runner 診斷檔案清理 (防止並行衝突)
# 注意: 不能刪除 $RUNNER_TEMP/* 因為包含 _runner_file_commands
- name: "Clean Runner Diagnostics"
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
rm -rf "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
mkdir -p "$RUNNER_ROOT/_diag/pages" 2>/dev/null || true
- uses: actions/checkout@v4
@@ -202,10 +204,11 @@ jobs:
image_tag: ${{ steps.tag.outputs.tag }}
steps:
# 2026-03-29: Runner 診斷檔案清理 (防止並行衝突)
# 注意: 不能刪除 $RUNNER_TEMP/* 因為包含 _runner_file_commands
- name: "Clean Runner Diagnostics"
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
rm -rf "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
mkdir -p "$RUNNER_ROOT/_diag/pages" 2>/dev/null || true
- uses: actions/checkout@v4
@@ -241,10 +244,11 @@ jobs:
image_tag: ${{ steps.tag.outputs.tag }}
steps:
# 2026-03-29: Runner 診斷檔案清理 (防止並行衝突)
# 注意: 不能刪除 $RUNNER_TEMP/* 因為包含 _runner_file_commands
- name: "Clean Runner Diagnostics"
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
rm -rf "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
mkdir -p "$RUNNER_ROOT/_diag/pages" 2>/dev/null || true
- uses: actions/checkout@v4
@@ -287,10 +291,11 @@ jobs:
environment: production
steps:
# 2026-03-29: Runner 診斷檔案清理 (防止並行衝突)
# 注意: 不能刪除 $RUNNER_TEMP/* 因為包含 _runner_file_commands
- name: "Clean Runner Diagnostics"
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
rm -rf "$RUNNER_ROOT/_diag/pages" .claude/worktrees 2>/dev/null || true
mkdir -p "$RUNNER_ROOT/_diag/pages" 2>/dev/null || true
- uses: actions/checkout@v4