@moo.md/hum 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/defaults/hum.json +14 -2
- package/defaults/roles/build.md +1 -1
- package/defaults/roles/fix.md +1 -1
- package/npm-shrinkwrap.json +3297 -0
- package/package.json +6 -2
- package/release.json +3 -0
- package/schema/hum.schema.json +251 -10
- package/scripts/eval.ts +21 -5
- package/src/adapter-api.ts +3 -1
- package/src/adapters/claude-bg.ts +2 -2
- package/src/adapters/claude-p.ts +44 -18
- package/src/adapters/contract.ts +12 -0
- package/src/adapters/fake.ts +5 -0
- package/src/adapters/git.ts +61 -9
- package/src/adapters/github-client.ts +15 -0
- package/src/adapters/github-commits.ts +84 -0
- package/src/adapters/github.ts +36 -4
- package/src/adapters/guard.ts +1 -0
- package/src/adapters/item-file.ts +1 -1
- package/src/adapters/markdown.ts +10 -1
- package/src/adapters/pull-requests.ts +8 -8
- package/src/adapters/registry.ts +5 -7
- package/src/adapters/roundup.ts +3 -0
- package/src/bytes.ts +1 -0
- package/src/cli/service.ts +176 -29
- package/src/cli/setup.ts +16 -7
- package/src/config/checks.ts +27 -43
- package/src/config/load.ts +2 -3
- package/src/config/machine.ts +29 -0
- package/src/config/migrate.ts +5 -2
- package/src/config/refusal.ts +9 -4
- package/src/config/schema.ts +86 -8
- package/src/config/wake-job.ts +78 -0
- package/src/decide/risk.ts +2 -2
- package/src/exec.ts +10 -0
- package/src/index.ts +1 -1
- package/src/loop/records.ts +8 -1
- package/src/measure/rate.ts +14 -0
- package/src/publish/bundle.ts +128 -0
- package/src/publish/handoff.ts +107 -0
- package/src/publish/handover.ts +182 -0
- package/src/publish/intents.ts +61 -0
- package/src/publish/publisher.ts +259 -0
- package/src/publish/wake.ts +78 -0
- package/src/service/ci-state.ts +99 -0
- package/src/service/plugins.ts +137 -0
- package/src/service/wake.ts +3 -1
- package/src/service/workflows.ts +261 -50
- package/src/setup/propose.ts +87 -3
- package/src/setup/prove.ts +3 -3
- package/src/setup/scan.ts +61 -5
- package/src/setup/tables.ts +18 -0
- package/src/setup/write.ts +52 -19
- package/src/state/items.ts +17 -8
- package/src/state/open.ts +20 -6
- package/src/state/records.ts +7 -0
- package/src/state/runs.ts +5 -0
- package/src/state/saved.ts +17 -2
- package/src/worker/base-check.ts +41 -13
- package/src/worker/checks.ts +3 -2
- package/src/worker/evidence.ts +72 -0
- package/src/worker/kind.ts +4 -7
- package/src/worker/land.ts +173 -81
- package/src/worker/merged.ts +20 -8
- package/src/worker/open.ts +33 -17
- package/src/worker/questions.ts +16 -8
- package/src/worker/signed-push.ts +167 -0
- package/src/worker/thin-path.ts +245 -133
- package/src/worker/worker.ts +50 -9
- package/surface.json +610 -76
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { type GitIdentity, gitIn, push } from "../adapters/git.ts";
|
|
5
|
+
import { HEARTBEAT_FILE, INBOX_DIR, PUBLISH_DIR, SLOTS_DIR, STATUS_FILE, STOPS_DIR } from "../state/open.ts";
|
|
6
|
+
|
|
7
|
+
/** Where a CI wake keeps hum's state for the next one. A ref holds no file, so no branch or checkout changes. Anyone who can read the repo can read it. */
|
|
8
|
+
export const CI_STATE_REF = "refs/hum/state";
|
|
9
|
+
|
|
10
|
+
/** The state files a job keeps to itself: what the view and the service unit poll, what a Mac's hooks and slots leave, and publish's repo. */
|
|
11
|
+
const JOB_ONLY = [STATUS_FILE, HEARTBEAT_FILE, `${INBOX_DIR}/`, `${STOPS_DIR}/`, `${SLOTS_DIR}/`, `${PUBLISH_DIR}/`];
|
|
12
|
+
|
|
13
|
+
const isJobOnly = (path: string): boolean => JOB_ONLY.some((name) => (name.endsWith("/") ? path.startsWith(name) : path === name));
|
|
14
|
+
|
|
15
|
+
const NO_REF = /couldn't find remote ref/i;
|
|
16
|
+
|
|
17
|
+
type CiStateOptions = {
|
|
18
|
+
/** The checkout whose git holds the objects. */
|
|
19
|
+
readonly repo: string;
|
|
20
|
+
readonly remote: string;
|
|
21
|
+
/** The state folder. */
|
|
22
|
+
readonly dir: string;
|
|
23
|
+
readonly timeoutMs: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** The state commit a wake read, which its save must replace; undefined where no wake saved before. */
|
|
27
|
+
export type CiStateRead = { readonly read: string | undefined };
|
|
28
|
+
|
|
29
|
+
/** A save lost the race: another wake saved after this one read, and hum never writes over that. */
|
|
30
|
+
export class CiStateRaced extends Error {
|
|
31
|
+
override name = "CiStateRaced";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Runs `use` with a scratch git index, removed after. */
|
|
35
|
+
const withScratchIndex = async <T>(use: (env: { readonly GIT_INDEX_FILE: string }) => Promise<T>): Promise<T> => {
|
|
36
|
+
const scratch = mkdtempSync(join(tmpdir(), "hum-state-index-"));
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
return await use({ GIT_INDEX_FILE: join(scratch, "index") });
|
|
40
|
+
} finally {
|
|
41
|
+
rmSync(scratch, { recursive: true, force: true });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** Writes the state the last wake saved into `dir`, and returns the commit read; a remote that holds none leaves `dir` as it is. */
|
|
46
|
+
export const restoreCiState = async ({ repo, remote, dir, timeoutMs }: CiStateOptions): Promise<CiStateRead> => {
|
|
47
|
+
const git = gitIn(repo, { timeoutMs });
|
|
48
|
+
const fetched = await git.run(["fetch", "--quiet", "--no-tags", remote, `+${CI_STATE_REF}:${CI_STATE_REF}`]);
|
|
49
|
+
|
|
50
|
+
if (fetched.code !== 0 && NO_REF.test(fetched.stderr)) return { read: undefined };
|
|
51
|
+
|
|
52
|
+
if (fetched.code !== 0) throw new Error(`hum could not read its saved state from ${remote}: ${fetched.stderr.trim()}`);
|
|
53
|
+
|
|
54
|
+
const read = (await git.raw(["rev-parse", CI_STATE_REF])).trim();
|
|
55
|
+
|
|
56
|
+
mkdirSync(dir, { recursive: true });
|
|
57
|
+
await withScratchIndex(async (env) => {
|
|
58
|
+
const indexed = gitIn(repo, { timeoutMs, env });
|
|
59
|
+
|
|
60
|
+
await indexed.raw(["read-tree", read]);
|
|
61
|
+
await indexed.raw(["checkout-index", "--all", "--force", `--prefix=${join(dir, "/")}`]);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return { read };
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** The tree of every state file the next wake needs, built through a scratch index so no work tree is touched. */
|
|
68
|
+
const stateTree = async ({ repo, dir, timeoutMs }: Omit<CiStateOptions, "remote">): Promise<string> => {
|
|
69
|
+
const git = gitIn(repo, { timeoutMs });
|
|
70
|
+
const files = existsSync(dir) ? [...new Bun.Glob("**").scanSync({ cwd: dir, onlyFiles: true, dot: true })].filter((path) => !isJobOnly(path)).sort() : [];
|
|
71
|
+
|
|
72
|
+
if (files.length === 0) return (await git.raw(["hash-object", "-w", "-t", "tree", "/dev/null"])).trim();
|
|
73
|
+
|
|
74
|
+
const blobs = (await git.raw(["hash-object", "-w", "--stdin-paths"], `${files.map((path) => join(dir, path)).join("\n")}\n`)).trim().split("\n");
|
|
75
|
+
|
|
76
|
+
return withScratchIndex(async (env) => {
|
|
77
|
+
const indexed = gitIn(repo, { timeoutMs, env });
|
|
78
|
+
|
|
79
|
+
await indexed.raw(["update-index", "--add", "--index-info"], files.map((path, at) => `100644 ${blobs[at]}\t${path}\n`).join(""));
|
|
80
|
+
|
|
81
|
+
return (await indexed.raw(["write-tree"])).trim();
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Saves the state folder to the remote as one commit with no parent, so the ref never grows, in place of the commit
|
|
87
|
+
* this wake read: a compare-and-swap, which throws `CiStateRaced` when another wake saved first. Returns the new read.
|
|
88
|
+
*/
|
|
89
|
+
export const saveCiState = async ({ read, identity, at, ...options }: CiStateOptions & CiStateRead & { readonly identity: GitIdentity; readonly at: number }): Promise<CiStateRead> => {
|
|
90
|
+
const git = gitIn(options.repo, { identity, timeoutMs: options.timeoutMs });
|
|
91
|
+
const commit = (await git.raw(["commit-tree", await stateTree(options), "-m", `hum state ${new Date(at).toISOString()}`])).trim();
|
|
92
|
+
const pushed = await push(git, [`--force-with-lease=${CI_STATE_REF}:${read ?? ""}`, options.remote, `${commit}:${CI_STATE_REF}`]);
|
|
93
|
+
|
|
94
|
+
if (pushed.kind === "conflict") throw new CiStateRaced(`another wake saved hum's state to ${CI_STATE_REF} after this one read it, so this wake's state was not saved`);
|
|
95
|
+
|
|
96
|
+
if (pushed.kind === "refused") throw new Error(`${options.remote} refused hum's state at ${CI_STATE_REF}: ${pushed.said}`);
|
|
97
|
+
|
|
98
|
+
return { read: commit };
|
|
99
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { existsSync, mkdtempSync, readFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { gitIn, whenGitFailed } from "../adapters/git.ts";
|
|
6
|
+
import { type Env, exec, SHIPPED_COMMAND_TIMEOUT_MS } from "../exec.ts";
|
|
7
|
+
|
|
8
|
+
/** The marketplace hope comes from, by the name its own manifest gives it. */
|
|
9
|
+
const MOO_MARKETPLACE = "moo.md";
|
|
10
|
+
|
|
11
|
+
const MOO_REPO = "https://github.com/saadshahd/moo.md";
|
|
12
|
+
|
|
13
|
+
const HOPE_PLUGIN = `hope@${MOO_MARKETPLACE}`;
|
|
14
|
+
|
|
15
|
+
/** The engine's folder: `hum-engine` in a moo.md checkout, `node_modules/@moo.md/hum` in an owner's repo. */
|
|
16
|
+
const ENGINE_ROOT = resolve(import.meta.dir, "..", "..");
|
|
17
|
+
|
|
18
|
+
/** The file the publish job writes beside the package: the moo.md commit it was published from. */
|
|
19
|
+
export const RELEASE_FILE = "release.json";
|
|
20
|
+
|
|
21
|
+
/** What `release.json` holds: the full sha of the moo.md commit the package was published from. */
|
|
22
|
+
export const Release = z.object({ commit: z.string().regex(/^[0-9a-f]{40}$/) });
|
|
23
|
+
|
|
24
|
+
/** A marketplace as a settings file declares it, in the forms `claude plugin marketplace add` takes. */
|
|
25
|
+
const Source = z.discriminatedUnion("source", [
|
|
26
|
+
z.looseObject({ source: z.literal("github"), repo: z.string().min(1), ref: z.string().min(1).optional(), path: z.never().optional() }),
|
|
27
|
+
z.looseObject({ source: z.literal("git"), url: z.string().min(1), ref: z.string().min(1).optional(), path: z.never().optional() }),
|
|
28
|
+
z.looseObject({ source: z.literal("url"), url: z.string().min(1) }),
|
|
29
|
+
z.looseObject({ source: z.literal("directory"), path: z.string().min(1) }),
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
/** What a repo's `.claude/settings.json` says about plugins; every other key is Claude Code's alone. */
|
|
33
|
+
export const RepoPlugins = z.looseObject({
|
|
34
|
+
extraKnownMarketplaces: z.record(z.string(), z.looseObject({ source: Source })).default({}),
|
|
35
|
+
enabledPlugins: z.record(z.string(), z.unknown()).default({}),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type RepoPlugins = z.infer<typeof RepoPlugins>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The moo.md commit this engine shipped with: the one its package was published from, or, where the engine runs from
|
|
42
|
+
* a moo.md checkout, that checkout's HEAD. Any other engine has none, and that throws: an unpinned hope could be one
|
|
43
|
+
* this engine was never released beside.
|
|
44
|
+
*/
|
|
45
|
+
export const shippedCommit = async (): Promise<string> => {
|
|
46
|
+
const file = join(ENGINE_ROOT, RELEASE_FILE);
|
|
47
|
+
|
|
48
|
+
if (existsSync(file)) return Release.parse(JSON.parse(readFileSync(file, "utf8"))).commit;
|
|
49
|
+
|
|
50
|
+
const git = gitIn(ENGINE_ROOT, { timeoutMs: SHIPPED_COMMAND_TIMEOUT_MS });
|
|
51
|
+
const top = (await git.raw(["rev-parse", "--show-toplevel"]).catch(whenGitFailed(""))).trim();
|
|
52
|
+
|
|
53
|
+
if (top === "" || resolve(top) !== resolve(ENGINE_ROOT, "..")) throw new Error(`this engine holds no ${RELEASE_FILE} and sits in no moo.md checkout, so it names no moo.md commit to install hope from`);
|
|
54
|
+
|
|
55
|
+
return (await git.raw(["rev-parse", "HEAD"])).trim();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const marketplaceArgument = (source: z.infer<typeof Source>, repo: string): string => {
|
|
59
|
+
switch (source.source) {
|
|
60
|
+
case "github":
|
|
61
|
+
return source.ref === undefined ? source.repo : `${source.repo}#${source.ref}`;
|
|
62
|
+
case "git":
|
|
63
|
+
return source.ref === undefined ? source.url : `${source.url}#${source.ref}`;
|
|
64
|
+
case "url":
|
|
65
|
+
return source.url;
|
|
66
|
+
case "directory":
|
|
67
|
+
return isAbsolute(source.path) ? source.path : join(repo, source.path);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const COMMIT_SHA = /^[0-9a-f]{40}$/;
|
|
72
|
+
|
|
73
|
+
/** A marketplace fetched from a repo by anything but a commit SHA installs whatever its branch or tag holds at the wake. */
|
|
74
|
+
const isUnpinned = (source: z.infer<typeof Source>): boolean => (source.source === "github" || source.source === "git") && !COMMIT_SHA.test(source.ref ?? "");
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The `claude` command lines that install hope and the repo's plugins: moo.md from `mooFolder`, its checkout at the
|
|
78
|
+
* shipped commit, which stands in for any moo.md the settings declare; each other marketplace they declare; then hope
|
|
79
|
+
* and every plugin they enable. A marketplace from a repo whose `ref` is no full commit SHA throws: its hooks would run
|
|
80
|
+
* in every run as whatever its branch or tag holds that day.
|
|
81
|
+
*/
|
|
82
|
+
export const pluginCommands = (settings: RepoPlugins, { repo, mooFolder }: { readonly repo: string; readonly mooFolder: string }): string[][] => {
|
|
83
|
+
const declared = Object.entries(settings.extraKnownMarketplaces).filter(([name]) => name !== MOO_MARKETPLACE);
|
|
84
|
+
const unpinned = declared.flatMap(([name, { source }]) => (isUnpinned(source) ? [name] : []));
|
|
85
|
+
|
|
86
|
+
if (unpinned.length > 0) throw new Error(`the marketplaces ${unpinned.join(", ")} in .claude/settings.json name no commit SHA as "ref", so a wake would install whatever their branch or tag holds, and their hooks run in every run. Give each a "ref" of a full 40-character commit SHA, which no push can move.`);
|
|
87
|
+
|
|
88
|
+
const marketplaces = declared.map(([, { source }]) => marketplaceArgument(source, repo));
|
|
89
|
+
const enabled = Object.entries(settings.enabledPlugins).flatMap(([id, on]) => (on === true ? [id] : []));
|
|
90
|
+
|
|
91
|
+
return [mooFolder, ...marketplaces].map((source) => ["plugin", "marketplace", "add", source]).concat([...new Set([HOPE_PLUGIN, ...enabled])].map((id) => ["plugin", "install", id]));
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** The plugin settings of the repo's `.claude/settings.json`; none where it has no such file. */
|
|
95
|
+
export const repoPlugins = (repo: string): RepoPlugins => {
|
|
96
|
+
const file = join(repo, ".claude", "settings.json");
|
|
97
|
+
|
|
98
|
+
return RepoPlugins.parse(existsSync(file) ? JSON.parse(readFileSync(file, "utf8")) : {});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** moo.md at `commit`, fetched alone into a new folder under `parent`. */
|
|
102
|
+
const checkOutMoo = async (commit: string, parent: string): Promise<string> => {
|
|
103
|
+
const folder = mkdtempSync(join(parent, "hum-moo-"));
|
|
104
|
+
const git = gitIn(folder, { timeoutMs: SHIPPED_COMMAND_TIMEOUT_MS });
|
|
105
|
+
|
|
106
|
+
await git.raw(["init", "-q"]);
|
|
107
|
+
await git.raw(["fetch", "-q", "--depth", "1", MOO_REPO, commit]);
|
|
108
|
+
await git.raw(["checkout", "-q", "FETCH_HEAD"]);
|
|
109
|
+
|
|
110
|
+
return folder;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type PluginInstall = {
|
|
114
|
+
readonly repo: string;
|
|
115
|
+
readonly env: Env;
|
|
116
|
+
/** Runs `claude` with these arguments; the CLI runs the real binary. */
|
|
117
|
+
readonly claude?: (args: readonly string[]) => Promise<{ readonly exitCode: number | undefined; readonly stdout: string; readonly stderr: string }>;
|
|
118
|
+
/** The moo.md folder to install from; by default a checkout of the shipped commit. */
|
|
119
|
+
readonly mooFolder?: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Installs hope and the repo's plugins for Claude Code in this job. A fresh checkout is a folder Claude Code does not
|
|
124
|
+
* trust, so it skips the marketplaces the repo's settings declare; this adds them as the user's own. The first command
|
|
125
|
+
* that fails throws, naming itself and what claude said.
|
|
126
|
+
*/
|
|
127
|
+
export const installPlugins = async ({ repo, env, claude = (args) => exec("claude", args, { throwOnError: false, timeoutMs: SHIPPED_COMMAND_TIMEOUT_MS, nodeOptions: { env } }), mooFolder }: PluginInstall): Promise<readonly string[][]> => {
|
|
128
|
+
const commands = pluginCommands(repoPlugins(repo), { repo, mooFolder: mooFolder ?? (await checkOutMoo(await shippedCommit(), env.RUNNER_TEMP ?? tmpdir())) });
|
|
129
|
+
|
|
130
|
+
for (const args of commands) {
|
|
131
|
+
const ran = await claude(args);
|
|
132
|
+
|
|
133
|
+
if (ran.exitCode !== 0) throw new Error(`claude ${args.join(" ")} exited ${ran.exitCode}: ${(ran.stderr || ran.stdout).trim()}`);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return commands;
|
|
137
|
+
};
|
package/src/service/wake.ts
CHANGED
|
@@ -5,12 +5,14 @@ import type { Worker } from "../worker/worker.ts";
|
|
|
5
5
|
/**
|
|
6
6
|
* CI wake: ticks, lets the runs it started end, and ticks again until a tick starts nothing. A CI job holds no
|
|
7
7
|
* session across a wait for the owner: a run that needs them has pushed its branch, asked on the item and ended.
|
|
8
|
+
* `afterTick` runs once each tick's runs have ended, so a job stopped at its time limit loses only the tick in flight.
|
|
8
9
|
*/
|
|
9
|
-
export const wakeUntilQuiet = async (worker: Worker): Promise<void> => {
|
|
10
|
+
export const wakeUntilQuiet = async (worker: Pick<Worker, "tick" | "idle">, afterTick: () => Promise<void> = async () => {}): Promise<void> => {
|
|
10
11
|
for (;;) {
|
|
11
12
|
const result = await worker.tick();
|
|
12
13
|
|
|
13
14
|
await worker.idle();
|
|
15
|
+
await afterTick();
|
|
14
16
|
|
|
15
17
|
if (result.kind !== "ran" || result.started.length === 0) return;
|
|
16
18
|
}
|
package/src/service/workflows.ts
CHANGED
|
@@ -1,31 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Document, visit } from "yaml";
|
|
2
2
|
import { CLAUDE_FLOOR } from "../adapters/claude-p.ts";
|
|
3
|
-
import type { HumConfig } from "../config/schema.ts";
|
|
3
|
+
import type { HumConfig, PullRequestToken } from "../config/schema.ts";
|
|
4
|
+
import { APP_TOKEN_ACTION, APP_TOKEN_MINUTES, CLAUDE_TOKEN, readsSecrets, secretsNamed, TRUSTED_ASSOCIATIONS, WAKE_ENV as ENV, WORKFLOW_FILES } from "../config/wake-job.ts";
|
|
5
|
+
import { ENGINE_VERSION } from "../state/format.ts";
|
|
6
|
+
import { MEGABYTE } from "../bytes.ts";
|
|
4
7
|
|
|
5
8
|
/** The settings the workflows are built from. */
|
|
6
|
-
export type WorkflowSettings = Pick<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
export type WorkflowSettings = Pick<
|
|
10
|
+
HumConfig,
|
|
11
|
+
"runBranchPrefix" | "itemsDir" | "ciSchedule" | "commitIdentity" | "ciWakeTimeoutMinutes" | "ciOutboxMaxMegabytes" | "pullRequestToken" | "ciRunner" | "ciContainer" | "ciEnv" | "ciClaudeAuth"
|
|
12
|
+
>;
|
|
9
13
|
|
|
10
14
|
/** The type of the `repository_dispatch` event a tracker's webhook sends. */
|
|
11
15
|
const DISPATCH_EVENT = "hum-wake";
|
|
12
16
|
|
|
13
|
-
const WAKE_PATH = `./.github/workflows/${
|
|
14
|
-
|
|
15
|
-
const TOKEN_SECRET = "CLAUDE_CODE_OAUTH_TOKEN";
|
|
16
|
-
|
|
17
|
-
const HOPE_MARKETPLACE = "saadshahd/moo.md";
|
|
17
|
+
const WAKE_PATH = `./.github/workflows/${WORKFLOW_FILES.wake}`;
|
|
18
18
|
|
|
19
19
|
/** The Bun that builds the workflows is the one the owner's repo runs, so CI installs with the same lockfile reader. */
|
|
20
20
|
const BUN_VERSION = Bun.version;
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Each action the workflows run, at the one commit its release is. A tag can move to code that then holds the App's
|
|
24
|
+
* private key and every secret of the job; a commit cannot. The release rides beside the commit as a comment.
|
|
25
|
+
*/
|
|
26
|
+
const ACTIONS = {
|
|
27
|
+
checkout: { uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1", release: "v7.0.1" },
|
|
28
|
+
appToken: { uses: `${APP_TOKEN_ACTION}@64ab729a6294000f5aa4a4bc0b73d1f32bc45510`, release: "v3.3.0" },
|
|
29
|
+
upload: { uses: "actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9", release: "v7.0.2" },
|
|
30
|
+
download: { uses: "actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333", release: "v8.0.2" },
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
const RELEASE_OF: ReadonlyMap<string, string> = new Map(Object.values(ACTIONS).map(({ uses, release }) => [uses, release]));
|
|
23
34
|
|
|
24
35
|
const PERMISSIONS = { contents: "write", issues: "write", "pull-requests": "write" } as const;
|
|
25
36
|
|
|
37
|
+
/** The workflow token's permissions: the App's, and reading the run's artifacts, which the publish job sizes before it downloads one. */
|
|
38
|
+
const WORKFLOW_PERMISSIONS = { ...PERMISSIONS, actions: "read" } as const;
|
|
39
|
+
|
|
26
40
|
/** One wake at a time: a second event waits for the first run instead of racing it. */
|
|
27
41
|
const CONCURRENCY = { group: "hum-wake", "cancel-in-progress": false } as const;
|
|
28
42
|
|
|
43
|
+
const APP_TOKEN_STEP = "app-token";
|
|
44
|
+
|
|
29
45
|
/** The events a trigger workflow starts on. */
|
|
30
46
|
type TriggerEvents = {
|
|
31
47
|
readonly issue_comment?: { readonly types: readonly string[] };
|
|
@@ -41,57 +57,252 @@ type TriggerJob = { readonly if?: string };
|
|
|
41
57
|
const trigger = (name: string, on: TriggerEvents, job: TriggerJob = {}) => ({
|
|
42
58
|
name,
|
|
43
59
|
on,
|
|
44
|
-
permissions:
|
|
60
|
+
permissions: WORKFLOW_PERMISSIONS,
|
|
45
61
|
concurrency: CONCURRENCY,
|
|
46
62
|
jobs: { wake: { ...job, uses: WAKE_PATH, secrets: "inherit" } },
|
|
47
63
|
});
|
|
48
64
|
|
|
65
|
+
const secret = (name: string): string => `\${{ secrets.${name} }}`;
|
|
66
|
+
|
|
67
|
+
/** The inputs that give an App's token the workflow's own permissions, each written out as the action names it. */
|
|
68
|
+
const APP_TOKEN_PERMISSIONS = {
|
|
69
|
+
"permission-contents": PERMISSIONS.contents,
|
|
70
|
+
"permission-issues": PERMISSIONS.issues,
|
|
71
|
+
"permission-pull-requests": PERMISSIONS["pull-requests"],
|
|
72
|
+
} as const;
|
|
73
|
+
|
|
74
|
+
/** Where the job keeps what would else be machine-wide: a runner GitHub does not host keeps its home folder between jobs, and empties its temp folder after each. */
|
|
75
|
+
const JOB_TOOLS = "$RUNNER_TEMP/hum-tools";
|
|
76
|
+
|
|
77
|
+
/** Later steps read git's global config from the job's temp folder and find the job's own tools first on PATH. */
|
|
78
|
+
const JOB_PATHS_STEP = {
|
|
79
|
+
run: `echo "${ENV.gitConfig}=$RUNNER_TEMP/hum-gitconfig" >> "$GITHUB_ENV"
|
|
80
|
+
echo "${JOB_TOOLS}/bin" >> "$GITHUB_PATH"
|
|
81
|
+
`,
|
|
82
|
+
} as const;
|
|
83
|
+
|
|
84
|
+
/** The YAML writer leaves out a key whose value is undefined, so a job that runs on the runner itself has no `container`. */
|
|
85
|
+
const NO_KEY = undefined;
|
|
86
|
+
|
|
87
|
+
const OPTIONAL_SECRET = { required: false } as const;
|
|
88
|
+
|
|
89
|
+
/** The secrets the owner's settings name. A called workflow reads only the secrets it declares, so each is declared, and none is required. */
|
|
90
|
+
const ownerSecrets = ({ ciRunner, ciContainer, ciEnv }: Pick<WorkflowSettings, "ciRunner" | "ciContainer" | "ciEnv">) =>
|
|
91
|
+
Object.fromEntries(secretsNamed(ciRunner, ciContainer, ciEnv).map((name) => [name, OPTIONAL_SECRET]));
|
|
92
|
+
|
|
93
|
+
/** `ciEnv` split by reach: a value that reads a secret goes to the step that runs hum alone, so no install step holds it. */
|
|
94
|
+
const envByReach = (ciEnv: WorkflowSettings["ciEnv"]) => ({
|
|
95
|
+
everyStep: Object.fromEntries(Object.entries(ciEnv).filter(([, value]) => !readsSecrets(value))),
|
|
96
|
+
humStep: Object.fromEntries(Object.entries(ciEnv).filter(([, value]) => readsSecrets(value))),
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/** The secret and env Claude Code signs in with: the OAuth token, or none where `ciEnv` carries the credentials. */
|
|
100
|
+
const CLAUDE_SIGN_IN = {
|
|
101
|
+
"oauth-token": { secrets: { [CLAUDE_TOKEN]: { required: true } }, env: { [CLAUDE_TOKEN]: secret(CLAUDE_TOKEN) } },
|
|
102
|
+
env: { secrets: {}, env: {} },
|
|
103
|
+
} as const satisfies Record<HumConfig["ciClaudeAuth"], { readonly secrets: object; readonly env: object }>;
|
|
104
|
+
|
|
49
105
|
/**
|
|
50
|
-
* The
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
106
|
+
* The secrets a wake's GitHub token comes from, the env and steps that turn them into it, and the expression that
|
|
107
|
+
* holds it. An App's token is minted with the workflow token's permissions, so both hold the same rights. A wake
|
|
108
|
+
* whose App secrets are unset stops at its first step and says which: with the workflow token in their place, the
|
|
109
|
+
* pull requests it opened would start no checks. A secret's token falls back to the workflow token while it is unset.
|
|
54
110
|
*/
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
111
|
+
const githubToken = (source: PullRequestToken) =>
|
|
112
|
+
source.from === "secret"
|
|
113
|
+
? { secrets: { [source.secret]: OPTIONAL_SECRET }, env: {}, check: [], steps: [], token: `\${{ secrets.${source.secret} || github.token }}` }
|
|
114
|
+
: {
|
|
115
|
+
secrets: { [source.clientIdSecret]: OPTIONAL_SECRET, [source.privateKeySecret]: OPTIONAL_SECRET },
|
|
116
|
+
env: { [ENV.hasApp]: `\${{ secrets.${source.clientIdSecret} != '' && secrets.${source.privateKeySecret} != '' }}` },
|
|
117
|
+
check: [
|
|
118
|
+
{
|
|
119
|
+
if: `env.${ENV.hasApp} != 'true'`,
|
|
120
|
+
run: `echo "::error title=hum::The GitHub App secrets ${source.clientIdSecret} and ${source.privateKeySecret} are not both set. A pull request opened with the workflow token starts no checks, so this wake stops. Set both secrets, or change pullRequestToken in .hum/hum.json."
|
|
121
|
+
exit 1
|
|
122
|
+
`,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
steps: [
|
|
126
|
+
{
|
|
127
|
+
id: APP_TOKEN_STEP,
|
|
128
|
+
uses: ACTIONS.appToken.uses,
|
|
129
|
+
with: {
|
|
130
|
+
"client-id": secret(source.clientIdSecret),
|
|
131
|
+
"private-key": secret(source.privateKeySecret),
|
|
132
|
+
...APP_TOKEN_PERMISSIONS,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
token: `\${{ steps.${APP_TOKEN_STEP}.outputs.token }}`,
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A run clones the repo again into a temp folder, so the git identity and credentials are global: the checkout's own
|
|
141
|
+
* are local to its workspace. Global here is the job's own file, which `JOB_PATHS_STEP` names, so no other job on the
|
|
142
|
+
* machine commits as hum. The credential helper hands git the token in the env when git asks, so git needs no `gh`,
|
|
143
|
+
* which a job container may lack. In a job container the runner's user may own the checkout while the steps run as
|
|
144
|
+
* root, and git refuses a repo another user owns until it is trusted.
|
|
145
|
+
*/
|
|
146
|
+
const gitSetup = ({ name, email }: HumConfig["commitIdentity"]) => ({
|
|
147
|
+
run: `git config --global user.name "$${ENV.gitName}"
|
|
148
|
+
git config --global user.email "$${ENV.gitEmail}"
|
|
149
|
+
git config --global credential.https://github.com.helper "$${ENV.gitCredentialHelper}"
|
|
150
|
+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
151
|
+
`,
|
|
152
|
+
env: {
|
|
153
|
+
[ENV.gitName]: name,
|
|
154
|
+
[ENV.gitEmail]: email,
|
|
155
|
+
[ENV.gitCredentialHelper]: `!f() { if [ "$1" = get ]; then echo username=x-access-token; echo "password=$${ENV.githubToken}"; fi; }; f`,
|
|
82
156
|
},
|
|
83
157
|
});
|
|
84
158
|
|
|
159
|
+
/** The inbox gather hands the work job, and the outbox the work job hands publish: one artifact each, kept a day. */
|
|
160
|
+
const HANDOVER = { inbox: "hum-inbox", outbox: "hum-outbox" } as const;
|
|
161
|
+
|
|
162
|
+
const RETENTION_DAYS = 1;
|
|
163
|
+
|
|
164
|
+
/** Where a handover sits on the runner: as an action's input reads it, and as a shell reads it. */
|
|
165
|
+
const handoverPath = (name: string): string => `\${{ runner.temp }}/${name}`;
|
|
166
|
+
|
|
167
|
+
const handoverFolder = (name: string): string => `"$RUNNER_TEMP/${name}"`;
|
|
168
|
+
|
|
169
|
+
const upload = (name: string) => ({ uses: ACTIONS.upload.uses, with: { name, path: handoverPath(name), "retention-days": RETENTION_DAYS, "if-no-files-found": "error" } });
|
|
170
|
+
|
|
171
|
+
const download = (name: string) => ({ uses: ACTIONS.download.uses, with: { name, path: handoverPath(name) } });
|
|
172
|
+
|
|
173
|
+
/** Stops the job before it downloads the artifact `name` when GitHub's artifacts API says it is larger than `maxBytes`, or the run holds no single one. */
|
|
174
|
+
const sizeCheck = (name: string, maxBytes: number) => ({
|
|
175
|
+
env: { [ENV.actionsToken]: "${{ github.token }}" },
|
|
176
|
+
run: `node --input-type=module -e '
|
|
177
|
+
const env = process.env;
|
|
178
|
+
const reply = await fetch(env.GITHUB_API_URL + "/repos/" + env.GITHUB_REPOSITORY + "/actions/runs/" + env.GITHUB_RUN_ID + "/artifacts?name=${name}", { headers: { authorization: "Bearer " + env.${ENV.actionsToken}, accept: "application/vnd.github+json" } });
|
|
179
|
+
if (!reply.ok) throw new Error("GitHub artifacts API answered " + reply.status);
|
|
180
|
+
const { artifacts } = await reply.json();
|
|
181
|
+
if (artifacts.length !== 1) throw new Error("the run holds " + artifacts.length + " artifacts named ${name}");
|
|
182
|
+
if (artifacts[0].size_in_bytes > ${maxBytes}) throw new Error("${name} holds " + artifacts[0].size_in_bytes + " bytes, over the ${maxBytes} bytes publish reads; this wake publishes nothing");
|
|
183
|
+
'
|
|
184
|
+
`,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/** What gather settled, as its job output: publish trusts it, and the work job checks out the base it names. */
|
|
188
|
+
const GATHERED = "${{ needs.gather.outputs.gathered }}";
|
|
189
|
+
|
|
190
|
+
const GATHERED_BASE = "${{ fromJSON(needs.gather.outputs.gathered).baseSha }}";
|
|
191
|
+
|
|
192
|
+
/** hum at this engine's own version from npm, which checks the package against the registry's integrity and installs each dependency at the version and hash its shrinkwrap pins; the jobs that hold GitHub's token run this hum and none of the repo's code. */
|
|
193
|
+
const PUBLISHED_HUM = `@moo.md/hum@${ENGINE_VERSION}`;
|
|
194
|
+
|
|
195
|
+
/** The tools every job installs at exact versions, each with the one install script that fetches its native binary. */
|
|
196
|
+
const TOOLS = [
|
|
197
|
+
{ spec: `bun@${BUN_VERSION}`, folder: "bun", script: "install.js" },
|
|
198
|
+
{ spec: `@anthropic-ai/claude-code@${CLAUDE_FLOOR}`, folder: "@anthropic-ai/claude-code", script: "install.cjs" },
|
|
199
|
+
] as const;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Installs the tools, and `extra` packages, with no package's install script, so no dependency of theirs runs code at
|
|
203
|
+
* install; then the tools' own scripts alone fetch their native binaries.
|
|
204
|
+
*/
|
|
205
|
+
const installTools = (extra = "") => ({
|
|
206
|
+
run: [`npm install --global --prefix "${JOB_TOOLS}" --ignore-scripts ${TOOLS.map(({ spec }) => spec).join(" ")}${extra}`, ...TOOLS.map(({ folder, script }) => `(cd "${JOB_TOOLS}/lib/node_modules/${folder}" && node ${script})`)].join("\n"),
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
/** Git in a job container trusts the checkout the runner's user owns; the global config is the job's own file. */
|
|
210
|
+
const SAFE_CHECKOUT = { run: 'git config --global --add safe.directory "$GITHUB_WORKSPACE"\n' } as const;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The wake, as three jobs. `gather` and `publish` hold GitHub's token and run hum as published, with none of the
|
|
214
|
+
* repo's code: no install of its packages, no hook and no check; each mints an App's token at its end, inside the
|
|
215
|
+
* token's hour. `work` holds no GitHub token: its workflow token reads the repo alone and stays out of the checkout,
|
|
216
|
+
* and everything it needs from GitHub reaches it in gather's inbox. Its runs and the repo's checks run there, and what
|
|
217
|
+
* they made goes to publish as the outbox, which publish checks before any write. The Claude sign-in and every `ciEnv`
|
|
218
|
+
* value that reads a secret reach the steps that run hum alone. A runner GitHub does not host keeps what a job leaves,
|
|
219
|
+
* so a process a run left could outlive the work job there: ephemeral runners close that.
|
|
220
|
+
*/
|
|
221
|
+
const wake = ({ commitIdentity, ciWakeTimeoutMinutes, ciOutboxMaxMegabytes, pullRequestToken, ciRunner, ciContainer, ciEnv, ciClaudeAuth }: WorkflowSettings) => {
|
|
222
|
+
const claude = CLAUDE_SIGN_IN[ciClaudeAuth];
|
|
223
|
+
const github = githubToken(pullRequestToken);
|
|
224
|
+
const env = envByReach(ciEnv);
|
|
225
|
+
const where = { "runs-on": ciRunner, container: ciContainer ?? NO_KEY };
|
|
226
|
+
const humEnv = { ...env.humStep, ...claude.env, [ENV.githubToken]: github.token };
|
|
227
|
+
const checkout = (ref?: string) => ({ uses: ACTIONS.checkout.uses, with: { ...(ref && { ref }), "fetch-depth": 0, "persist-credentials": false } });
|
|
228
|
+
|
|
229
|
+
/** A job that holds GitHub's token: hum from npm, git that pushes as hum, and the token minted last. It installs no plugin: it makes judgment calls alone, which load none. */
|
|
230
|
+
const holdsToken = ({ before, ref, run, permissions = PERMISSIONS }: { readonly before: readonly object[]; readonly ref?: string; readonly run: object; readonly permissions?: typeof PERMISSIONS }) => ({
|
|
231
|
+
...where,
|
|
232
|
+
permissions,
|
|
233
|
+
"timeout-minutes": APP_TOKEN_MINUTES,
|
|
234
|
+
env: { ...env.everyStep, ...github.env, [ENV.event]: "${{ github.event_name }}" },
|
|
235
|
+
steps: [...github.check, checkout(ref), JOB_PATHS_STEP, installTools(` ${PUBLISHED_HUM}`), gitSetup(commitIdentity), ...before, ...github.steps, run],
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
name: "hum wake",
|
|
240
|
+
on: { workflow_call: { secrets: { ...ownerSecrets({ ciRunner, ciContainer, ciEnv }), ...claude.secrets, ...github.secrets } } },
|
|
241
|
+
permissions: {},
|
|
242
|
+
jobs: {
|
|
243
|
+
gather: {
|
|
244
|
+
...holdsToken({ before: [], run: { id: "gather", run: `hum wake gather --inbox ${handoverFolder(HANDOVER.inbox)}`, env: humEnv } }),
|
|
245
|
+
outputs: { gathered: "${{ steps.gather.outputs.gathered }}" },
|
|
246
|
+
},
|
|
247
|
+
work: {
|
|
248
|
+
needs: "gather",
|
|
249
|
+
...where,
|
|
250
|
+
permissions: { contents: "read" },
|
|
251
|
+
"timeout-minutes": ciWakeTimeoutMinutes,
|
|
252
|
+
env: Object.keys(env.everyStep).length > 0 ? env.everyStep : NO_KEY,
|
|
253
|
+
steps: [
|
|
254
|
+
checkout(GATHERED_BASE),
|
|
255
|
+
JOB_PATHS_STEP,
|
|
256
|
+
installTools(),
|
|
257
|
+
{ run: "bun install --frozen-lockfile" },
|
|
258
|
+
{ run: "./node_modules/.bin/hum plugins" },
|
|
259
|
+
SAFE_CHECKOUT,
|
|
260
|
+
download(HANDOVER.inbox),
|
|
261
|
+
{ run: `./node_modules/.bin/hum wake work --inbox ${handoverFolder(HANDOVER.inbox)} --outbox ${handoverFolder(HANDOVER.outbox)}`, env: { ...env.humStep, ...claude.env } },
|
|
262
|
+
upload(HANDOVER.outbox),
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
publish: {
|
|
266
|
+
needs: ["gather", "work"],
|
|
267
|
+
...holdsToken({ ref: GATHERED_BASE, permissions: WORKFLOW_PERMISSIONS, before: [sizeCheck(HANDOVER.outbox, ciOutboxMaxMegabytes * MEGABYTE), download(HANDOVER.outbox)], run: { run: `hum wake publish --outbox ${handoverFolder(HANDOVER.outbox)} --event "$${ENV.event}"`, env: { ...humEnv, [ENV.gathered]: GATHERED } } }),
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/** An item push wakes hum only on the default branch: a wake runs the checked-out branch's code with every secret, and anyone who may push a branch could change that code. */
|
|
274
|
+
const ON_DEFAULT_BRANCH = "github.ref_name == github.event.repository.default_branch";
|
|
275
|
+
|
|
276
|
+
/** A comment wakes hum only when a person the repo trusts wrote it: on a public repo anyone may comment, and a wake holds every secret. */
|
|
277
|
+
const TRUSTED_COMMENT = `github.event.comment.user.type != 'Bot' && contains(fromJSON('${JSON.stringify(TRUSTED_ASSOCIATIONS)}'), github.event.comment.author_association)`;
|
|
278
|
+
|
|
279
|
+
type Workflow = ReturnType<typeof wake> | ReturnType<typeof trigger>;
|
|
280
|
+
|
|
281
|
+
/** A workflow as YAML, each pinned action followed by its release as a comment, and a value two keys share written out under both. */
|
|
282
|
+
const render = (workflow: Workflow): string => {
|
|
283
|
+
const document = new Document(workflow, { aliasDuplicateObjects: false });
|
|
284
|
+
|
|
285
|
+
visit(document, {
|
|
286
|
+
Scalar: (_key, node) => {
|
|
287
|
+
const release = RELEASE_OF.get(String(node.value));
|
|
288
|
+
|
|
289
|
+
if (release !== undefined) node.comment = ` ${release}`;
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
return document.toString({ lineWidth: 0 });
|
|
294
|
+
};
|
|
295
|
+
|
|
85
296
|
const WORKFLOWS = {
|
|
86
|
-
[
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
} as const satisfies Record<
|
|
297
|
+
[WORKFLOW_FILES.wake]: wake,
|
|
298
|
+
[WORKFLOW_FILES.comment]: () => trigger("hum on comment", { issue_comment: { types: ["created"] } }, { if: TRUSTED_COMMENT }),
|
|
299
|
+
[WORKFLOW_FILES.push]: ({ itemsDir, runBranchPrefix }) => trigger("hum on item push", { push: { branches: ["**", `!${runBranchPrefix}**`], paths: [`${itemsDir}/**`] } }, { if: ON_DEFAULT_BRANCH }),
|
|
300
|
+
[WORKFLOW_FILES.dispatch]: () => trigger("hum on dispatch", { repository_dispatch: { types: [DISPATCH_EVENT] } }),
|
|
301
|
+
[WORKFLOW_FILES.schedule]: ({ ciSchedule }) => trigger("hum on schedule", { schedule: [{ cron: ciSchedule }], workflow_dispatch: null }),
|
|
302
|
+
} as const satisfies Record<(typeof WORKFLOW_FILES)[keyof typeof WORKFLOW_FILES], (settings: WorkflowSettings) => object>;
|
|
92
303
|
|
|
93
304
|
export type WorkflowFile = { readonly file: string; readonly text: string };
|
|
94
305
|
|
|
95
306
|
/** The workflow files for an owner's repo, each named for `.github/workflows/`. */
|
|
96
307
|
export const ciWorkflows = (settings: WorkflowSettings): WorkflowFile[] =>
|
|
97
|
-
Object.entries(WORKFLOWS).map(([file, build]) => ({ file, text:
|
|
308
|
+
Object.entries(WORKFLOWS).map(([file, build]) => ({ file, text: render(build(settings)) }));
|