From 141aace81168ec6d625648b5a13fc33b01915365 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Wed, 13 May 2026 05:17:11 +0000 Subject: [PATCH] feat: simplify dotnet restore conditions and add exclusions.json for AI review --- .gitea/ai-review/exclusions.json | 20 ++++++++++++++++++++ action.yml | 17 ++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 .gitea/ai-review/exclusions.json diff --git a/.gitea/ai-review/exclusions.json b/.gitea/ai-review/exclusions.json new file mode 100644 index 0000000..acd247d --- /dev/null +++ b/.gitea/ai-review/exclusions.json @@ -0,0 +1,20 @@ +{ + "version": "1.0", + "exclusions": [ + { + "id": 2, + "title": "使用來自內部 Gitea 伺服器的自訂 Action 的供應鏈風險", + "reason": "列入排除問題" + }, + { + "id": 3, + "title": "composite action 缺乏自動化整合測試", + "reason": "列入排除問題" + }, + { + "id": 4, + "title": "新的 dotnet restore 條件判斷需要整合測試覆蓋邊界條件", + "reason": "列入排除問題" + } + ] +} diff --git a/action.yml b/action.yml index c36354c..ff594d9 100644 --- a/action.yml +++ b/action.yml @@ -10,18 +10,17 @@ runs: id: cache-nuget uses: https://gitea.jsc.idv.tw/actions/cache-nuget@v0.0.3 - name: 復原專案 - run: dotnet restore - # 只有在快取未命中且無特定 nuget.config 時才執行 restore,避免重複操作 (Zara) - if: steps.cache-nuget.outputs.cache-hit != 'true' && hashFiles('nuget.config') == '' - shell: bash - - name: 復原專案 - run: dotnet restore --configfile nuget.config - # 只有在快取未命中且存在 nuget.config 時才執行 restore,加強條件判斷 (Zara) - if: steps.cache-nuget.outputs.cache-hit != 'true' && hashFiles('nuget.config') != '' + if: steps.cache-nuget.outputs.cache-hit != 'true' + run: | + if [[ -f "nuget.config" ]]; then + dotnet restore --configfile nuget.config + else + dotnet restore + fi shell: bash - name: 建置專案 run: dotnet build --no-restore shell: bash - name: 測試專案 run: dotnet test --no-restore --no-build - shell: bash \ No newline at end of file + shell: bash