Files
ai-code-review/action.yml
T
JefferyandClaude Opus 4.8 05178be520
node-actions/template: CI / BUILD (pull_request) Successful in 5s
CI / TEST (Claude) (pull_request) Successful in 28s
CI / TEST (Antigravity) (pull_request) Successful in 57s
CI / TEST (Codex) (pull_request) Successful in 3m10s
fix(推送觸發 CI): 合併 push-token 進 token,findings 一律以 token 認證推送觸發 CI
- 移除 push-token input,token 兼作 Gitea API 認證與 findings 推送
- commitAndPushFindings 一律以 token 明確認證推送(不走 origin 自動 token);
  只要 token 為能觸發 CI 的 PAT,結果 commit 即再觸發 PR 的 CI,避免新 head 缺檢查卡合併
- ci.yaml 三個 job 移除 push-token,保留 token: ${{ secrets.TOKEN }}

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 17:24:18 +08:00

56 lines
3.9 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================================
# 用途:定義 AI Code Review Node action 的名稱、輸入參數與 Node.js 24 進入點,供 Gitea / GitHub workflow 以 uses 引用。
# 更新時間:2026/07/17 18:49:58
# ============================================================================
# Gitea / GitHub node action 的 manifestaction.yml):
# 定義本 action 的名稱、說明、輸入參數(inputs)與執行方式(runs),
# 供呼叫端 workflow 以 `uses:` 引用;runner 讀取此檔後以 node24 執行 src/index.js。
# action 顯示名稱:呼叫端 workflow log 與 marketplace 列表上看到的名稱。
name: 'AI Code Review'
# action 用途說明:多角色 AI code review 流程(攻擊方找問題、防守方裁決誤報),
# 審查結果會留言到 PR 並保存 findings.gitea/ai-review/findings/)。
description: 'AI 多角色 code review:攻擊方找問題、防守方裁決誤報,結果留言到 PR 並保存 findings'
# action 作者資訊(僅供辨識,不影響執行)。
author: 'Jeffery'
# 輸入參數區塊:呼叫端 workflow 以 `with:` 傳入,
# runner 會自動注入為 INPUT_* 環境變數(例如 INPUT_TOKEN、INPUT_MODEL、INPUT_CREATE-ISSUE)供主程式讀取。
inputs:
# Gitea API token:用於對 PRissue 留言審查結果,以及 push 審查結果檔(findings/exclusions)回 repo。
token:
# 參數用途說明:secrets/vars context 在 action 內不可用,故由呼叫端 workflow 以 secrets 傳入。
# 建議傳入「能觸發 CI 的 PAT」:以自動 tokengitea.token / GITHUB_TOKEN)推送的結果 commit 不會
# 再觸發 CI,導致新 head 缺檢查而卡合併;改用 PAT 推送會讓 PR 的 synchronize 事件再觸發 CI
# 由主程式步驟 1 快速回報([success]/[failure])廉價地把結果蓋到新 head。
description: 'Gitea API tokenPR/issue 留言與 push findings 用;建議以能觸發 CI 的 PAT 由 secrets 傳入)'
# 必填:缺少 token 無法呼叫 Gitea APIaction 無法運作。
required: true
# 指定 AI 工具使用的模型名稱。
model:
# 參數用途說明:留空表示使用各 AI 工具自身的預設模型。
description: '指定 AI 工具使用的模型(空值=各工具預設)'
# 選填:未指定時採用預設值。
required: false
# 預設為空字串,代表不覆寫各工具的預設模型。
default: ''
# 建問題模式開關:是否把審查保留的問題另建 issue 追蹤。
create-issue:
# 參數用途說明:字串 'true' 時建立 issue(標題=PR 標題、描述=PR 描述、AI 挑標籤),
# 並逐條留言問題明細,findings 檔不進版控、收尾只 commit exclusions.json
# 預設 'false' 走原流程(findings 檔與 exclusions.json 一併 commit 回 PR 來源分支)。
description: '是否將問題建到存取庫的問題追蹤(true 時建立 issue 逐條留言問題明細,最後只 commit exclusions.json;預設 false 走原流程)'
# 選填:未指定時採用預設值。
required: false
# 預設為字串 'false',代表不啟用建問題模式(主程式只認字串 'true' 才啟用)。
default: 'false'
# 執行方式區塊:宣告本 action 為 node action 及其進入點。
runs:
# 以 Node.js 24 runtime 直接在 runner 上執行(非 Docker 容器、非 composite)。
using: 'node24'
# 主程式進入點:直接指向 src/index.jsentry point)。
# 主程式為零外部相依(package.json 無 dependenciessrc 僅 require Node 內建模組與本地 lib),
# runner 不會自動 npm install,零相依時依 node action 慣例 main 直接指向 src/index.js 即正確;
# 日後若新增外部相依,需改以 @vercel/ncc 打包(package.json 已備有 build script),
# 並將 main 改指 dist/index.js、把 dist/ commit 進 repo。
main: 'src/index.js'