try esm action

This commit is contained in:
Pullfrog Action
2025-11-06 19:00:07 -05:00
parent 5a21d40d27
commit 7ef44eb254
9 changed files with 86 additions and 410 deletions
+8 -4
View File
@@ -15,15 +15,19 @@ export function createMcpConfigs(githubInstallationToken: string): McpConfigs {
const repoContext = parseRepoContext();
const githubRepository = `${repoContext.owner}/${repoContext.name}`;
// Get absolute path to entry.cjs - use GITHUB_ACTION_PATH if available, otherwise current directory
// Get absolute path to entry.js - use GITHUB_ACTION_PATH if available, otherwise current directory
const entryPath = process.env.GITHUB_ACTION_PATH
? `${process.env.GITHUB_ACTION_PATH}/entry.cjs`
: `${process.cwd()}/entry.cjs`;
? `${process.env.GITHUB_ACTION_PATH}/entry.js`
: `${process.cwd()}/entry.js`;
return {
[ghPullfrogMcpName]: {
command: "node",
args: ["-e", `require('${entryPath.replace(/'/g, "\\'")}').createMcpServer()`],
args: [
"--input-type=module",
"-e",
`import('${entryPath.replace(/'/g, "\\'")}').then(m => m.createMcpServer())`,
],
env: {
GITHUB_INSTALLATION_TOKEN: githubInstallationToken,
GITHUB_REPOSITORY: githubRepository,