# ============================================================================= # 用途: calculate-version 專案的 CI workflow。 # 在 Pull Request 開啟或更新時,觸發 OpenCode AI 程式碼審查。 # 更新日期: 2026/06/30 12:12:59 # ============================================================================= # workflow 名稱,顯示於 Gitea Actions 介面。 name: CI # 觸發條件設定。 on: # 於 Pull Request 事件觸發。 pull_request: # 忽略目標分支為 master 的 PR (master 走 CD 流程,不在此審查)。 branches-ignore: - master # 僅在 PR 開啟 (opened) 或有新 commit 推送 (synchronize) 時觸發。 types: [opened, synchronize] jobs: # job 識別碼:AI 程式碼審查。 ai-code-review: # job 顯示名稱。 name: AI Code Review # 指定執行於 ubuntu runner。 runs-on: ubuntu # 此 job 所需的權限 (供 AI 寫回審查結果)。 permissions: # 可寫入儲存庫內容。 contents: write # 可在 PR 上留言/變更狀態。 pull-requests: write # 可建立/更新 issue。 issues: write steps: # 呼叫共用的 OpenCode 程式碼審查 composite action。 - name: AI 程式碼審查 by OpenCode # 版本以變數 ACTION_OPENCODE_CODE_REVIEW_VERSION 控制,便於統一升級。 uses: https://gitea.jsc.idv.tw/composite-actions/opencode-code-review@${{ vars.ACTION_OPENCODE_CODE_REVIEW_VERSION }} with: # 傳入留言用 token (secret),供 action 在 PR 上發表審查留言。 comment_token: ${{ secrets.COMMENT_TOKEN }}