fix(推送觸發 CI): 合併 push-token 進 token,findings 一律以 token 認證推送觸發 CI
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

- 移除 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>
This commit is contained in:
Jeffery
2026-07-20 17:24:18 +08:00
co-authored by Claude Opus 4.8
parent 9e6e8bb793
commit 05178be520
5 changed files with 18 additions and 50 deletions
+6 -15
View File
@@ -16,11 +16,13 @@ author: 'Jeffery'
# 輸入參數區塊:呼叫端 workflow 以 `with:` 傳入,
# runner 會自動注入為 INPUT_* 環境變數(例如 INPUT_TOKEN、INPUT_MODEL、INPUT_CREATE-ISSUE)供主程式讀取。
inputs:
# Gitea API token:用於對 PR 留言審查結果以及 push 審查結果檔回 repo。
# Gitea API token:用於對 PRissue 留言審查結果以及 push 審查結果檔findings/exclusions回 repo。
token:
# 參數用途說明:secrets/vars context 在 action 內不可用,
# 故由呼叫端 workflow 以 secrets.GITHUB_TOKEN 傳入。
description: 'Gitea API tokenPR 留言與 push findings 用;呼叫端以 secrets.GITHUB_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 工具使用的模型名稱。
@@ -41,17 +43,6 @@ inputs:
required: false
# 預設為字串 'false',代表不啟用建問題模式(主程式只認字串 'true' 才啟用)。
default: 'false'
# 推送用 PAT:推送 findings/exclusions commit 時改以此 token 進行。
push-token:
# 參數用途說明:以自動 tokengitea.token / GITHUB_TOKEN)推送的 commit 不會再觸發 CI,
# 導致新 head 缺檢查而卡合併;改用 PAT 推送會讓 PR 的 synchronize 事件再觸發 CI
# 由主程式步驟 1 快速回報([success]/[failure])廉價地把結果蓋到新 head。
# 呼叫端以 secrets 傳入(例如 secrets.TOKEN)。留空=退回以 token 走 origin 推送(不會再觸發)。
description: '推送 findings/exclusions commit 用的 PAT(讓 CI 再觸發;呼叫端以 secrets 傳入;留空=退回 token 推送、不再觸發)'
# 選填:未指定時退回以 token 推送。
required: false
# 預設為空字串,代表不使用專用推送 PAT。
default: ''
# 執行方式區塊:宣告本 action 為 node action 及其進入點。
runs:
# 以 Node.js 24 runtime 直接在 runner 上執行(非 Docker 容器、非 composite)。