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" +}