From 1f2e2d1b8084efc1fb0e9f40d36e412cda92d517 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Wed, 13 May 2026 03:36:30 +0000 Subject: [PATCH] fix: update checkout action version and refine restore conditions in action.yml --- action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 180110f..c36354c 100644 --- a/action.yml +++ b/action.yml @@ -5,16 +5,19 @@ runs: using: 'composite' steps: - name: 取得專案 - uses: actions/checkout@v6 + uses: actions/checkout@v6.0.2 - name: 快取 NUGET 套件 + id: cache-nuget uses: https://gitea.jsc.idv.tw/actions/cache-nuget@v0.0.3 - name: 復原專案 run: dotnet restore - if: ${{ hashFiles('nuget.config') == '' }} + # 只有在快取未命中且無特定 nuget.config 時才執行 restore,避免重複操作 (Zara) + if: steps.cache-nuget.outputs.cache-hit != 'true' && hashFiles('nuget.config') == '' shell: bash - name: 復原專案 run: dotnet restore --configfile nuget.config - if: ${{ hashFiles('nuget.config') != '' }} + # 只有在快取未命中且存在 nuget.config 時才執行 restore,加強條件判斷 (Zara) + if: steps.cache-nuget.outputs.cache-hit != 'true' && hashFiles('nuget.config') != '' shell: bash - name: 建置專案 run: dotnet build --no-restore