From e17c25ce390e83df2af4615b450f45d36cce2e2d Mon Sep 17 00:00:00 2001 From: Jeffery Date: Sat, 27 Jun 2026 13:30:50 +0000 Subject: [PATCH] =?UTF-8?q?chore(ci):=20=E8=AA=BF=E6=95=B4=20AI=20?= =?UTF-8?q?=E5=AF=A9=E6=9F=A5=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=A8=8B=E8=88=87?= =?UTF-8?q?=E6=A0=B9=E7=9B=AE=E9=8C=84=E6=B8=AC=E8=A9=A6=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yaml | 21 ++++++++++++++++----- package.json | 15 +++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 package.json diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 0377269..fd2171e 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -16,10 +16,22 @@ on: types: [opened, synchronize] # 定義此 workflow 的 jobs jobs: + release-tag-version: + name: Release Tag Version + runs-on: ubuntu + outputs: + version: ${{ steps.release-tag-version.outputs.version }} + steps: + - name: 計算版本號 + id: release-tag-version + uses: https://gitea.jsc.idv.tw/composite-actions/release-tag-version@${{ vars.ACTION_RELEASE_TAG_VERSION }} + with: + is_beta: 'true' # job 識別碼:ai-code-review ai-code-review: # job 顯示名稱 name: AI Code Review + needs: release-tag-version # 指定執行環境的 runner 標籤:ubuntu runs-on: ubuntu # 此 job 所需的權限設定 @@ -34,15 +46,14 @@ jobs: steps: - name: 取得程式碼 uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }} - # 步驟名稱:呼叫 OpenCode 進行 AI 程式碼審查 + - name: 安裝 AI 工具 + uses: https://gitea.jsc.idv.tw/docker-actions/antigravity@${{ vars.ACTION_ANTIGRAVITY_VERSION }} - name: AI 程式碼審查 # 使用外部 composite action 執行審查邏輯 # 版本由 repository variable ACTION_OPENCODE_CODE_REVIEW_VERSION 決定,便於集中管理版本 - uses: ./ + uses: https://gitea.jsc.idv.tw/docker-actions/ai-code-review@v${{ needs.release-tag-version.outputs.version }} # 傳遞給 composite action 的輸入參數 with: # 留言用 token:取自 secret COMMENT_TOKEN,供 action 在 PR 上發布審查留言 token: ${{ secrets.TOKEN }} - opencode_base_url: ${{ vars.OPENCODE_BASE_URL }} - opencode_provider: ${{ vars.OPENCODE_PROVIDER }} - opencode_model: ${{ vars.OPENCODE_PROVIDER_MODEL }} + model: ${{ vars.AI_CODE_REVIEW_MODEL }} diff --git a/package.json b/package.json new file mode 100644 index 0000000..2272d1b --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "ai-code-review", + "version": "1.0.0", + "description": "AI code review Gitea action", + "private": true, + "scripts": { + "test": "npm --prefix app test" + }, + "repository": { + "type": "git", + "url": "https://gitea.jsc.idv.tw/docker-actions/ai-code-review.git" + }, + "author": "Jeffery", + "license": "ISC" +}