From b8a15883ab16f0d3864d0664c1fef7da581f2f4e Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 26 Jun 2026 14:59:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20token=20=E5=8F=83=E6=95=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yaml | 2 +- action.yaml | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 0dbeac1..bd6a187 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: # 傳遞給 composite action 的輸入參數 with: # 留言用 token:取自 secret COMMENT_TOKEN,供 action 在 PR 上發布審查留言 - comment_token: ${{ secrets.COMMENT_TOKEN }} + token: ${{ secrets.COMMENT_TOKEN }} opencode_base_url: ${{ vars.OPENCODE_BASE_URL }} opencode_provider: ${{ vars.OPENCODE_PROVIDER }} opencode_model: ${{ vars.OPENCODE_PROVIDER_MODEL }} diff --git a/action.yaml b/action.yaml index 7873e0f..31e568a 100644 --- a/action.yaml +++ b/action.yaml @@ -2,9 +2,12 @@ name: 'AI Code Review' description: 'AI 程式碼審查' author: 'Jeffery' inputs: - comment_token: + token: description: '' required: true + comment_token: + description: '' + required: false opencode_base_url: description: 'OpenCode server Base URL' required: false @@ -20,8 +23,8 @@ runs: env: GITEA_SERVER_URL: ${{ gitea.server_url }} GITEA_REPOSITORY: ${{ gitea.repository }} - GITEA_TOKEN: ${{ gitea.token }} - GITEA_COMMENT_TOKEN: ${{ inputs.comment_token }} + 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 }}