Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bb1b779a8 | |||
| 599264694e | |||
| b9c15e9f38 |
@@ -5,8 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import { type } from "arktype";
|
import { type Inputs, main } from "./main.ts";
|
||||||
import { Inputs, main } from "./main.ts";
|
|
||||||
import { createMcpServer } from "./mcp/server.ts";
|
import { createMcpServer } from "./mcp/server.ts";
|
||||||
import packageJson from "./package.json" with { type: "json" };
|
import packageJson from "./package.json" with { type: "json" };
|
||||||
import { log } from "./utils/cli.ts";
|
import { log } from "./utils/cli.ts";
|
||||||
@@ -18,13 +17,10 @@ async function run(): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
log.info(`🐸 Running pullfrog/action@${packageJson.version}...`);
|
log.info(`🐸 Running pullfrog/action@${packageJson.version}...`);
|
||||||
|
|
||||||
const inputsJson = process.env.INPUTS_JSON;
|
const inputs: Inputs = {
|
||||||
if (!inputsJson) {
|
prompt: core.getInput("prompt", { required: true }),
|
||||||
throw new Error("INPUTS_JSON environment variable not found");
|
anthropic_api_key: core.getInput("anthropic_api_key") || undefined,
|
||||||
}
|
};
|
||||||
|
|
||||||
const parsed = type("string.json.parse").assert(inputsJson);
|
|
||||||
const inputs = Inputs.assert(parsed);
|
|
||||||
|
|
||||||
const result = await main(inputs);
|
const result = await main(inputs);
|
||||||
|
|
||||||
|
|||||||
+6
-4
@@ -11,15 +11,17 @@ await build({
|
|||||||
target: "node20",
|
target: "node20",
|
||||||
minify: true,
|
minify: true,
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
// Mark all node_modules as external - Node.js will handle ESM/CJS interop natively
|
// Bundle all dependencies - GitHub Actions doesn't have node_modules
|
||||||
// This avoids esbuild's require() polyfill which doesn't work in ESM
|
// Only mark optional peer dependencies as external
|
||||||
packages: "external",
|
|
||||||
// Mark optional peer dependencies as external
|
|
||||||
external: [
|
external: [
|
||||||
"@valibot/to-json-schema",
|
"@valibot/to-json-schema",
|
||||||
"effect",
|
"effect",
|
||||||
"sury",
|
"sury",
|
||||||
],
|
],
|
||||||
|
// Provide a proper require shim for CommonJS modules bundled into ESM
|
||||||
|
banner: {
|
||||||
|
js: `import { createRequire } from 'module'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; const require = createRequire(import.meta.url); const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename);`,
|
||||||
|
},
|
||||||
// Enable tree-shaking to remove unused code
|
// Enable tree-shaking to remove unused code
|
||||||
treeShaking: true,
|
treeShaking: true,
|
||||||
// Drop console statements in production (but keep for debugging)
|
// Drop console statements in production (but keep for debugging)
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pullfrog/action",
|
"name": "@pullfrog/action",
|
||||||
"version": "0.0.76",
|
"version": "0.0.78",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"index.js",
|
"index.js",
|
||||||
|
|||||||
@@ -41,8 +41,16 @@ export function setupTestRepo(options: SetupOptions): void {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup git configuration to avoid identity errors
|
* Setup git configuration to avoid identity errors
|
||||||
|
* Only runs in GitHub Actions environment to avoid overwriting local git config
|
||||||
*/
|
*/
|
||||||
export function setupGitConfig(): void {
|
export function setupGitConfig(): void {
|
||||||
|
// Only set up git config in GitHub Actions environment
|
||||||
|
// In local development, use the user's existing git config
|
||||||
|
if (!process.env.GITHUB_ACTIONS) {
|
||||||
|
log.info("⚠️ Skipping git configuration setup (not in GitHub Actions)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
log.info("🔧 Setting up git configuration...");
|
log.info("🔧 Setting up git configuration...");
|
||||||
execSync('git config user.email "action@pullfrog.ai"', { stdio: "inherit" });
|
execSync('git config user.email "action@pullfrog.ai"', { stdio: "inherit" });
|
||||||
execSync('git config user.name "Pullfrog Action"', { stdio: "inherit" });
|
execSync('git config user.name "Pullfrog Action"', { stdio: "inherit" });
|
||||||
|
|||||||
Reference in New Issue
Block a user