mirror of
https://github.com/morluto/rea.git
synced 2026-10-19 04:19:54 -05:00
* perf(ci): start source feedback early and diagnose stalled runs * fix(ci): verify workflow identities before main comparison limits * fix(ci): preserve diagnostics across passing checks and install failures * fix(ci): preserve ambiguous workflow run ordering * fix(ci): preserve failure-report candidate and request budgets * fix(ci): retain candidate errors while checking later main evidence * fix(ci): retain partial reports and require complete health scans * test(ci): prune stale fixtures and duplicated assumptions
16 lines
574 B
JavaScript
16 lines
574 B
JavaScript
/** Keep the API path as evidence and parse its optional ref at the boundary. */
|
|
export function normalizeWorkflowRun(value) {
|
|
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
throw new Error("workflow_run_malformed");
|
|
const match =
|
|
typeof value.path === "string" && !/[\u0000-\u001f\u007f]/u.test(value.path)
|
|
? /^(\.github\/workflows\/[^/\\@\s]+\.ya?ml)(?:@([^\s]+))?$/u.exec(
|
|
value.path,
|
|
)
|
|
: null;
|
|
return {
|
|
...value,
|
|
workflowPath: match ? { file: match[1], ref: match[2] ?? null } : null,
|
|
};
|
|
}
|