fix: YAML-first 治理 CI/CD target (#919)

* docs: specify cicd yaml target governance

* fix: resolve cicd targets from yaml

---------

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-26 01:14:38 +08:00
committed by GitHub
parent 3777577df4
commit edfddd2445
35 changed files with 1079 additions and 181 deletions
+4 -2
View File
@@ -1,3 +1,4 @@
// SPEC: PJ2026-01060308 cicd-yaml-targets draft-2026-06-25-cicd-yaml-targets.
import { randomUUID } from "node:crypto";
import { Buffer } from "node:buffer";
import { existsSync, readFileSync } from "node:fs";
@@ -1348,8 +1349,9 @@ function validateConfig(config: WechatArchiveConfig): void {
validatePersonalWechatIngress(config.personalWechatIngress);
}
function assertTarget(config: WechatArchiveConfig, targetId: string): void {
if (targetId !== config.target.id) throw new Error(`wechat archive target ${targetId} is not declared in ${configLabel}`);
function assertTarget(config: WechatArchiveConfig, targetId: string | null): void {
const resolved = targetId ?? config.target.id;
if (resolved !== config.target.id) throw new Error(`wechat archive target ${resolved} is not declared in ${configLabel}`);
}
function configSummary(config: WechatArchiveConfig): Record<string, unknown> {