17 Commits

Author SHA1 Message Date
jiantw83 89d18e39b9 Merge pull request 'chore: update ai review workflow' (#9) from develop into master
Reviewed-on: #9
2026-05-16 14:39:32 +00:00
jiantw83 edab8c3514 Merge pull request 'chore: update ai review workflow' (#8) from feat/ai_code_review into develop
Reviewed-on: #8
2026-05-16 14:38:47 +00:00
jiantw83 c5e6c54f51 chore: update ai review workflow 2026-05-16 14:36:57 +00:00
jiantw83 f758e069c6 Merge pull request 'feat: AI Code Review' (#7) from develop into master
Reviewed-on: #7
2026-05-13 02:50:12 +00:00
jiantw83 8edb66b504 fix: remove branches-ignore for master in review workflow 2026-05-13 02:48:37 +00:00
AI Review Bot 523fe213a8 chore: update ai-review findings [skip ci] 2026-05-12 10:42:32 +00:00
jiantw83 5046ec88c1 更新 .gitea/workflows/review.yaml 2026-05-12 10:26:47 +00:00
jiantw83 4c00e43b07 更新 .gitea/workflows/master.yaml 2026-05-12 10:26:34 +00:00
jiantw83 7dd61d58a6 新增 .gitea/workflows/review.yaml 2026-05-12 10:23:13 +00:00
jiantw83 53a5758356 刪除 .gitea/workflows/review.yaml 2026-05-12 10:22:43 +00:00
jiantw83 c8ed4645eb 新增 .gitea/workflows/review.yaml 2026-05-12 10:22:17 +00:00
admin 1c1fc49a9d Merge pull request 'fix: 取得環境變數的方法' (#4) from develop into master
Reviewed-on: #4
Reviewed-by: 系統管理員 <admin@noreply.localhost>
2026-05-06 03:17:47 +00:00
Jeffery 13c7b4bd84 fix: 取得環境變數的方法 2026-05-06 11:17:09 +08:00
jiantw83 71927eb541 Merge pull request '更新 action.yml' (#3) from develop into master
Reviewed-on: #3
2026-05-06 03:10:43 +00:00
jiantw83 90b76e2a74 更新 action.yml
fix: 修正環境變數要判斷的參數
2026-05-06 03:10:16 +00:00
jiantw83 96afa5815c Merge pull request '更新 action.yml' (#2) from develop into master
Reviewed-on: #2
2026-05-06 03:02:54 +00:00
jiantw83 dfcaa0c63c Merge pull request 'feat: 加入 DOTNET_ENVIRONMENT 參數' (#1) from develop into master
Reviewed-on: #1
2026-05-06 01:50:44 +00:00
4 changed files with 51 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
[
{
"level": "critical",
"role": "Leo",
"location": ".gitea/workflows/review.yaml:13",
"suggestion": "將 `GEMINI_API_KEY` 參數中串接 20 個 API 金鑰的方式進行重構。這種寫法極度冗長,難以閱讀、維護和除錯。如果 Gitea Action 支援多個金鑰,應考慮使用更結構化的方式傳遞(例如,如果 Action 支援 YAML 列表或單一包含所有金鑰的 Secret)。如果 Action 預期單一金鑰,則此配置可能導致錯誤。建議與 Action 的開發者確認其支援的多金鑰機制,或考慮在 Action 內部處理金鑰輪替邏輯,以簡化工作流程配置。",
"is_new": true
},
{
"level": "critical",
"role": "Rex",
"location": ".gitea/workflows/review.yaml:18-20",
"suggestion": "新建立的 `review.yaml` 工作流程賦予 `code-review` action 過於寬泛的權限,特別是 `contents: write`。這允許該 action 修改程式碼庫內容,若 action 存在漏洞或被惡意利用,可能導致程式碼注入、竄改或刪除。請重新評估 `code-review` action 所需的最小權限。如果僅需評論 PR`pull-requests: write` 和 `issues: write` 可能已足夠,但仍需謹慎。建議限制為只讀權限,或僅授予評論 PR 的權限,並確保 action 不會執行不必要的寫入操作。",
"is_new": true
},
{
"level": "warning",
"role": "Rex",
"location": ".gitea/workflows/master.yaml:13\n.gitea/workflows/review.yaml:12",
"suggestion": "兩個工作流程都使用了來自 `https://gitea.jsc.idv.tw` 的外部 action (`calculate-version` 和 `code-review`)。這引入了供應鏈風險,因為這些 action 的安全性直接影響到整個 CI/CD 流程。如果 `gitea.jsc.idv.tw` 受到損害,或這些 action 包含惡意程式碼,可能會導致嚴重的安全問題。建議對這些外部 action 的原始碼進行嚴格審查,確保其安全性,並考慮將其託管在內部或使用更受信任的來源。同時,確保使用固定的版本號(例如 `v1.2.3` 而非 `main` 或 `latest`)來避免意外的行為變更。",
"is_new": true
}
]
+3 -2
View File
@@ -1,10 +1,11 @@
name: CD
on:
push:
branches:
- master
jobs:
version:
name: "CD > 計算版本號"
name: 計算版本號
runs-on: ubuntu
outputs:
version: ${{ steps.version.outputs.version }}
@@ -13,7 +14,7 @@ jobs:
id: version
uses: https://gitea.jsc.idv.tw/actions/calculate-version@${{ vars.ACTION_CALCULATE_VERSION }}
release:
name: "CD > 發布專案"
name: 發布專案
runs-on: ubuntu
needs: version
steps:
+23
View File
@@ -0,0 +1,23 @@
name: AI
on:
pull_request:
branches-ignore:
- master
types: [opened, synchronize]
jobs:
code-review:
name: Code Review
runs-on: ubuntu
steps:
- name: AI Code Review
uses: https://gitea.jsc.idv.tw/actions/code-review@${{ vars.ACTION_CODE_REVIEW_VERSION }}
with:
GITEA_TOKEN: ${{ secrets.RUNNER_TOKEN }}
GITEA_COMMENT_TOKEN: ${{ secrets.GITEA_TOKEN }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }},${{ secrets.GEMINI_API_KEY_1 }},${{ secrets.GEMINI_API_KEY_2 }},${{ secrets.GEMINI_API_KEY_3 }},${{ secrets.GEMINI_API_KEY_4 }},${{ secrets.GEMINI_API_KEY_5 }},${{ secrets.GEMINI_API_KEY_6 }},${{ secrets.GEMINI_API_KEY_7 }},${{ secrets.GEMINI_API_KEY_8 }},${{ secrets.GEMINI_API_KEY_9 }},${{ secrets.GEMINI_API_KEY_10 }},${{ secrets.GEMINI_API_KEY_11 }},${{ secrets.GEMINI_API_KEY_12 }},${{ secrets.GEMINI_API_KEY_13 }},${{ secrets.GEMINI_API_KEY_14 }},${{ secrets.GEMINI_API_KEY_15 }},${{ secrets.GEMINI_API_KEY_16 }},${{ secrets.GEMINI_API_KEY_17 }},${{ secrets.GEMINI_API_KEY_18 }},${{ secrets.GEMINI_API_KEY_19 }}
GEMINI_BASE_URL: https://generativelanguage.googleapis.com/v1beta
GEMINI_MODEL: ${{ vars.GEMINI_MODEL }}
permissions:
contents: write
pull-requests: write
issues: write
+2 -2
View File
@@ -25,10 +25,10 @@ runs:
- name: 安裝套件
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ ASPNETCORE_ENVIRONMENT || inputs.DOTNET_VERSION }}
dotnet-version: ${{ inputs.DOTNET_VERSION }}
- name: 資料庫移轉
env:
ASPNETCORE_ENVIRONMENT: ${{ inputs.DOTNET_ENVIRONMENT }}
ASPNETCORE_ENVIRONMENT: ${{ env.ASPNETCORE_ENVIRONMENT || inputs.DOTNET_ENVIRONMENT }}
run: dotnet ef database update --project ../${{ inputs.MIGRATION_PROJECT_NAME }} --context ${{ inputs.MIGRATION_CONTEXT }}
shell: bash
working-directory: ${{ inputs.PROJECT_NAME }}