chore(Docker action): 整理 Docker action 執行設定

This commit is contained in:
2026-06-29 10:49:22 +00:00
parent 0b59ca6023
commit 45b6abacc8
4 changed files with 29 additions and 96 deletions
+14 -25
View File
@@ -4,34 +4,23 @@ author: 'Jeffery'
inputs:
token:
description: ''
required: true
required: false
comment_token:
description: ''
required: false
model:
description: ''
description: '要使用的 AI 助理 CLI 模型識別字串'
required: true
runs:
using: 'composite'
steps:
- name: 安裝 Node.js 相依套件
shell: bash
run: |
cd "${GITHUB_ACTION_PATH:-${GITEA_ACTION_PATH:-.}}/app"
npm ci
- name: 執行 AI 程式碼審查
shell: bash
env:
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
GITEA_TOKEN: ${{ inputs.token || gitea.token }}
GITEA_COMMENT_TOKEN: ${{ inputs.comment_token || inputs.token || gitea.token }}
PR_NUMBER: ${{ gitea.event.pull_request.number }}
PR_HEAD_SHA: ${{ gitea.event.pull_request.head.sha }}
PR_HEAD_BRANCH: ${{ gitea.event.pull_request.head.ref }}
PR_BASE_BRANCH: ${{ gitea.event.pull_request.base.ref }}
MODEL: ${{ inputs.model }}
run: |
echo "🚀 AI Code Review Action 啟動"
cd "${GITHUB_ACTION_PATH:-${GITEA_ACTION_PATH:-.}}/app"
node main.js
using: 'docker'
image: 'Dockerfile'
env:
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
GITEA_TOKEN: ${{ inputs.token || gitea.token }}
GITEA_COMMENT_TOKEN: ${{ inputs.comment_token || inputs.token || gitea.token }}
PR_NUMBER: ${{ gitea.event.pull_request.number }}
PR_HEAD_SHA: ${{ gitea.event.pull_request.head.sha }}
PR_HEAD_BRANCH: ${{ gitea.event.pull_request.head.ref }}
PR_BASE_BRANCH: ${{ gitea.event.pull_request.base.ref }}
MODEL: ${{ inputs.model }}