try esm action
This commit is contained in:
+8
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user