This commit is contained in:
2026-06-01 20:41:34 -05:00
parent 46d95853ae
commit 59f1e72dec
2 changed files with 19 additions and 22 deletions
+1 -22
View File
@@ -22,28 +22,7 @@ inputs:
runs:
using: "node24"
main: "entry.ts"
post-if: "always()"
main: "bootstrap.ts"
# BOT_TOKEN, OLLAMA_HOST, and GITEA_URL must be set as env vars by the consuming workflow.
# GITHUB_EVENT_NAME, GITHUB_EVENT_PATH, and GITHUB_REPOSITORY are set by the runner.
# runs:
# using: composite
# steps:
# - uses: oven-sh/setup-bun@v2
# - name: Install dependencies
# shell: bash
# working-directory: ${{ github.action_path }}
# run: bun install --frozen-lockfile
# - name: Run shockbot
# shell: bash
# working-directory: ${{ github.action_path }}
# env:
# INPUT_PROMPT: ${{ inputs.prompt }}
# INPUT_MODEL: ${{ inputs.model }}
# INPUT_CONTEXT_WINDOW: ${{ inputs.context_window }}
# INPUT_MAX_TOOL_CALLS: ${{ inputs.max_tool_calls }}
# run: bun run entry.ts
+18
View File
@@ -0,0 +1,18 @@
import { existsSync } from "node:fs";
import { execSync } from "node:child_process";
import { fileURLToPath } from "node:url";
import { dirname } from "node:path";
const dir = dirname(fileURLToPath(import.meta.url));
if (!existsSync(`${dir}/node_modules`)) {
console.log("node_modules not found, installing dependencies...");
try {
execSync("bun install --frozen-lockfile", { stdio: "inherit", cwd: dir, timeout: 120_000 });
} catch {
console.log("bun unavailable, falling back to npm...");
execSync("npm install --no-fund --no-audit", { stdio: "inherit", cwd: dir, timeout: 120_000 });
}
}
await import("./entry.ts");