mirror of
https://github.com/morluto/rea.git
synced 2026-10-11 21:39:55 +00:00
* fix(ci): scope documentation checks and cancel superseded runs * ci: reuse package runners for native Inspector checks * test(ci): share deterministic workflow Git fixtures
34 lines
915 B
TypeScript
34 lines
915 B
TypeScript
import { execFile } from "node:child_process";
|
|
import { join } from "node:path";
|
|
import { promisify } from "node:util";
|
|
|
|
/** Execute a fixture command while retaining its output and native exit status. */
|
|
export const executeWorkflowFixture = promisify(execFile);
|
|
|
|
/** Run fixture Git commands with deterministic dates and no workstation hooks. */
|
|
export async function workflowGit(
|
|
directory: string,
|
|
args: readonly string[],
|
|
date = "2026-01-04T00:00:00Z",
|
|
) {
|
|
const result = await executeWorkflowFixture(
|
|
"git",
|
|
[
|
|
"-c",
|
|
"user.name=REA fixture",
|
|
"-c",
|
|
"[email protected]",
|
|
"-c",
|
|
"commit.gpgsign=false",
|
|
"-c",
|
|
`core.hooksPath=${join(directory, "no-hooks")}`,
|
|
...args,
|
|
],
|
|
{
|
|
cwd: directory,
|
|
env: { ...process.env, GIT_AUTHOR_DATE: date, GIT_COMMITTER_DATE: date },
|
|
},
|
|
);
|
|
return result.stdout.trim();
|
|
}
|