start mcp server in memory
This commit is contained in:
@@ -7,9 +7,13 @@
|
||||
import * as core from "@actions/core";
|
||||
import { type } from "arktype";
|
||||
import { Inputs, main } from "./main.ts";
|
||||
import { createMcpServer } from "./mcp/server.ts";
|
||||
import packageJson from "./package.json" with { type: "json" };
|
||||
import { log } from "./utils/cli.ts";
|
||||
|
||||
// Export createMcpServer so it can be called from the spawned MCP process
|
||||
export { createMcpServer };
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
log.info(`🐸 Running pullfrog/action@${packageJson.version}...`);
|
||||
@@ -33,4 +37,11 @@ async function run(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
await run();
|
||||
// Only run main action if INPUTS_JSON is set (running as GitHub Action)
|
||||
// When SDK spawns MCP server, it calls createMcpServer() directly
|
||||
if (process.env.INPUTS_JSON) {
|
||||
// Wrap in IIFE to avoid top-level await in CJS
|
||||
(async () => {
|
||||
await run();
|
||||
})();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user