feat: adapt pullfrog for gitea + ollama
This commit is contained in:
@@ -1,7 +1,34 @@
|
||||
#!/usr/bin/env node
|
||||
// Self-bootstrapping entry point — only uses Node stdlib so it runs before
|
||||
// node_modules exists. Installs deps, then dynamically imports the action.
|
||||
|
||||
import { runPullfrogCli } from "./runCli.ts";
|
||||
import { existsSync } from "node:fs";
|
||||
import { execSync } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname } from "node:path";
|
||||
|
||||
runPullfrogCli({
|
||||
cliArgs: ["gha"],
|
||||
});
|
||||
const dir = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
if (!existsSync(`${dir}/node_modules`)) {
|
||||
console.error("» installing dependencies...");
|
||||
execSync("npm install --no-fund --no-audit", {
|
||||
cwd: dir,
|
||||
stdio: "inherit",
|
||||
timeout: 120_000,
|
||||
});
|
||||
}
|
||||
|
||||
const [{ main }, core] = await Promise.all([
|
||||
import(`${dir}/main.ts`),
|
||||
import("@actions/core"),
|
||||
]);
|
||||
|
||||
main()
|
||||
.then((result: { success: boolean; error?: string }) => {
|
||||
if (!result.success) {
|
||||
core.setFailed(result.error ?? "shockbot run failed");
|
||||
}
|
||||
})
|
||||
.catch((err: unknown) => {
|
||||
core.setFailed(err instanceof Error ? err.message : String(err));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user