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>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9e6e8bb793
commit
05178be520
+2
-6
@@ -20,7 +20,6 @@ const path = require('path');
|
||||
* token: string,
|
||||
* model: string,
|
||||
* createIssue: boolean,
|
||||
* pushToken: string,
|
||||
* event: Object,
|
||||
* pr: (Object|null),
|
||||
* prNumber: (number|null),
|
||||
@@ -38,12 +37,11 @@ const path = require('path');
|
||||
* - repository:`owner/repo` 全名(GITHUB_REPOSITORY)。
|
||||
* - owner / repo:自 repository 拆出的擁有者與專案名,缺值時為空字串。
|
||||
* - apiBase:Gitea REST API 基底網址(`<serverUrl>/api/v1`)。
|
||||
* - token:action input `token`(INPUT_TOKEN),用於 API 認證,缺值時為空字串。
|
||||
* - token:action input `token`(INPUT_TOKEN),用於 Gitea API 認證,以及 push findings/exclusions
|
||||
* commit 回 repo;建議為「能觸發 CI 的 PAT」(自動 token 推送不會再觸發 CI)。缺值時為空字串。
|
||||
* - model:action input `model`(INPUT_MODEL,已 trim),指定 AI 模型,缺值時為空字串。
|
||||
* - createIssue:action input `create-issue`(INPUT_CREATE-ISSUE),是否將問題建到
|
||||
* 存取庫的問題追蹤(建問題模式);trim + 小寫後與字串 'true' 嚴格比對,預設 false。
|
||||
* - pushToken:action input `push-token`(INPUT_PUSH-TOKEN),推送 findings/exclusions commit 用的 PAT;
|
||||
* 提供時以 PAT 身分推送使 CI 再觸發(配合步驟 1 快速回報);留空=退回以 token 走 origin 推送(不會再觸發)。
|
||||
* - event:事件 payload 解析後的完整物件;讀取失敗時為空物件。
|
||||
* - pr:payload 內的 pull_request 物件;非 PR 事件時為 null。
|
||||
* - prNumber:PR 編號,優先取 payload,退而從 GITHUB_REF(refs/pull/N/...)解析;皆無時為 null。
|
||||
@@ -95,8 +93,6 @@ function loadContext() {
|
||||
model: (process.env.INPUT_MODEL || '').trim(),
|
||||
// 是否將問題建到存取庫的問題追蹤(input: create-issue,字串 'true' 才啟用,預設否)。
|
||||
createIssue: (process.env['INPUT_CREATE-ISSUE'] || '').trim().toLowerCase() === 'true',
|
||||
// 推送 findings/exclusions commit 用的 PAT(input: push-token);提供時以 PAT 推送讓 CI 再觸發,留空=退回 token。
|
||||
pushToken: (process.env['INPUT_PUSH-TOKEN'] || '').trim(),
|
||||
event,
|
||||
pr,
|
||||
prNumber,
|
||||
|
||||
Reference in New Issue
Block a user