mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
063fcaf89e
* improve(ci): add trusted FRV proof broker * fix(ci): tighten FRV proof broker boundaries * test(ci): narrow FRV broker workflow lookup * fix(ci): renew FRV broker mutation authority * fix(ci): bind FRV proof to broker attempt
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
export type BrokerContext = {
|
|
actor: string;
|
|
correlation: string;
|
|
headSha: string;
|
|
prNumber: number;
|
|
repository: "openclaw/openclaw";
|
|
runId: number;
|
|
workflowSha: string;
|
|
};
|
|
|
|
export type GitHubApi = {
|
|
request(method: string, path: string, body?: unknown): Promise<unknown>;
|
|
};
|
|
|
|
export type FixtureRunExpectation = {
|
|
attempt: number;
|
|
branch: string;
|
|
conclusion: "failure" | "success";
|
|
correlation: string;
|
|
headSha: string;
|
|
repository: string;
|
|
runId?: number;
|
|
};
|
|
|
|
export type ProofReceipt = {
|
|
actor: string;
|
|
correlation: string;
|
|
fixtureRunAttempt: 2;
|
|
fixtureRunId: number;
|
|
headSha: string;
|
|
operation: "noop";
|
|
prNumber: number;
|
|
repository: "openclaw/openclaw";
|
|
sourceRef: "refs/heads/main";
|
|
workflowSha: string;
|
|
};
|
|
|
|
export function validateBrokerRequest(event: unknown, env: NodeJS.ProcessEnv): BrokerContext;
|
|
export function validateFixtureRun(
|
|
value: unknown,
|
|
expected: FixtureRunExpectation,
|
|
): Record<string, unknown>;
|
|
export function runProofBroker(options: {
|
|
api: GitHubApi;
|
|
env: NodeJS.ProcessEnv;
|
|
event: unknown;
|
|
sleep?: (milliseconds: number) => Promise<void>;
|
|
}): Promise<ProofReceipt>;
|
|
export function createGitHubApi(options: {
|
|
repository: string;
|
|
token: string;
|
|
fetchImpl?: typeof fetch;
|
|
}): GitHubApi;
|