From 8ee2437a7fc56c0fa54eed59205d62f8424865a0 Mon Sep 17 00:00:00 2001 From: OG T Date: Thu, 26 Mar 2026 01:05:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20Runner=20=E6=9A=AB=E5=AD=98=E7=9B=AE?= =?UTF-8?q?=E9=8C=84=E6=B8=85=E7=90=86=20-=20=E6=B0=B8=E4=B9=85=E4=BF=AE?= =?UTF-8?q?=E5=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 每個 Job 開始前清理 $RUNNER_TEMP/* - 新增 crontab 每小時自動清理 - 新增 ~/bin/runner-cleanup.sh 腳本 Co-Authored-By: Claude Opus 4.5 --- .github/workflows/cd.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index e349a1dc..2c71d363 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -55,6 +55,12 @@ jobs: runs-on: [self-hosted, harbor, k8s] timeout-minutes: 1 steps: + # 2026-03-26: 清理暫存目錄,避免 set_output file conflict + - name: "Clean Runner temp" + run: | + rm -rf "$RUNNER_TEMP"/* 2>/dev/null || true + rm -rf .claude/worktrees 2>/dev/null || true + - name: "Check Required Secrets" run: | MISSING="" @@ -103,8 +109,9 @@ jobs: api: ${{ inputs.force_deploy == true && 'true' || steps.filter.outputs.api }} web: ${{ inputs.force_deploy == true && 'true' || steps.filter.outputs.web }} steps: - - name: Clean worktrees - run: rm -rf .claude/worktrees 2>/dev/null || true + # 2026-03-26: 清理暫存目錄 + - name: "Clean Runner temp" + run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true - uses: actions/checkout@v4 with: @@ -138,6 +145,10 @@ jobs: outputs: image_tag: ${{ steps.tag.outputs.tag }} steps: + # 2026-03-26: 清理暫存目錄 + - name: "Clean Runner temp" + run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true + - uses: actions/checkout@v4 - name: Generate tag @@ -170,6 +181,10 @@ jobs: outputs: image_tag: ${{ steps.tag.outputs.tag }} steps: + # 2026-03-26: 清理暫存目錄 + - name: "Clean Runner temp" + run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true + - uses: actions/checkout@v4 - name: Generate tag @@ -209,8 +224,9 @@ jobs: if: always() && (needs.build-api.result == 'success' || needs.build-api.result == 'skipped') && (needs.build-web.result == 'success' || needs.build-web.result == 'skipped') environment: production steps: - - name: Clean worktrees - run: rm -rf .claude/worktrees 2>/dev/null || true + # 2026-03-26: 清理暫存目錄 + - name: "Clean Runner temp" + run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true - uses: actions/checkout@v4 with: