idk
This commit is contained in:
+1
-22
@@ -22,28 +22,7 @@ inputs:
|
|||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "node24"
|
using: "node24"
|
||||||
main: "entry.ts"
|
main: "bootstrap.ts"
|
||||||
post-if: "always()"
|
|
||||||
|
|
||||||
# BOT_TOKEN, OLLAMA_HOST, and GITEA_URL must be set as env vars by the consuming workflow.
|
# 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.
|
# 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
|
|
||||||
|
|||||||
@@ -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");
|
||||||
Reference in New Issue
Block a user