From 280bb7ef15e0abc7049e871b669b2dd760d4fd4c Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Tue, 13 Jan 2026 08:11:59 +0000 Subject: [PATCH] Fix vercel build --- README.md | 2 +- entry | 32 +++++++++++++++++++++++--------- main.ts | 2 +- utils/setup.ts | 40 ++++++++++++++++++++++++++++++---------- 4 files changed, 55 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 4a7fc23..dbed262 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ## What is Pullfrog? -Pullfrog is a GitHub bot that brings the full power of your favorite coding agents into GitHub. It's open source and powered by GitHub Actions. +Pullfrog is a GitHub bot that brings the full power of your favorite coding agents into GitHub. It's open source and powered by GitHub Actions. - **Tag `@pullfrog`** — Tag `@pullfrog` in a comment anywhere in your repo. It will pull in any relevant context using the action's internal MCP server and perform the appropriate task. - **Prompt from the web** — Trigger arbitrary tasks from the Pullfrog dashboard diff --git a/entry b/entry index ffc60cc..6348cfb 100755 --- a/entry +++ b/entry @@ -138319,21 +138319,35 @@ function setupGitConfig() { const repoDir = process.cwd(); log.info("\xBB setting up git configuration..."); try { - execSync2('git config --local user.email "team@pullfrog.com"', { - cwd: repoDir, - stdio: "pipe" - }); - execSync2('git config --local user.name "pullfrog"', { - cwd: repoDir, - stdio: "pipe" - }); + let currentEmail = ""; + try { + currentEmail = execSync2("git config user.email", { + cwd: repoDir, + stdio: "pipe", + encoding: "utf-8" + }).trim(); + } catch { + } + const shouldSetDefaults = !currentEmail || currentEmail === "github-actions[bot]@users.noreply.github.com"; + if (shouldSetDefaults) { + execSync2('git config --local user.email "team@pullfrog.com"', { + cwd: repoDir, + stdio: "pipe" + }); + execSync2('git config --local user.name "pullfrog"', { + cwd: repoDir, + stdio: "pipe" + }); + log.debug("\xBB git user configured (using defaults)"); + } else { + log.debug(`\xBB git user already configured (${currentEmail}), skipping`); + } if (!process.env.GITHUB_ACTIONS) { execSync2('git config --local credential.helper ""', { cwd: repoDir, stdio: "pipe" }); } - log.debug("\xBB git configuration set successfully (scoped to repo)"); } catch (error50) { log.warning( `Failed to set git config: ${error50 instanceof Error ? error50.message : String(error50)}` diff --git a/main.ts b/main.ts index cd1e614..6b49a86 100644 --- a/main.ts +++ b/main.ts @@ -97,7 +97,7 @@ export async function main(inputs: Inputs): Promise { toolState, }), ]); - + timer.checkpoint("agentSetup+gitAuth"); // phase 6: compute modes diff --git a/utils/setup.ts b/utils/setup.ts index 66a8458..8f1dfea 100644 --- a/utils/setup.ts +++ b/utils/setup.ts @@ -29,20 +29,41 @@ export function setupTestRepo(options: SetupOptions): void { /** * Setup git configuration to avoid identity errors * Uses --local flag to scope config to the current repo only + * Only sets defaults if not already configured (respects workflow config) */ export function setupGitConfig(): void { const repoDir = process.cwd(); log.info("» setting up git configuration..."); try { - // Use --local to scope config to this repo only, preventing leakage to user's global config - execSync('git config --local user.email "team@pullfrog.com"', { - cwd: repoDir, - stdio: "pipe", - }); - execSync('git config --local user.name "pullfrog"', { - cwd: repoDir, - stdio: "pipe", - }); + // check current config - only set defaults if not configured or using generic bot + let currentEmail = ""; + try { + currentEmail = execSync("git config user.email", { + cwd: repoDir, + stdio: "pipe", + encoding: "utf-8", + }).trim(); + } catch { + // not configured + } + + const shouldSetDefaults = + !currentEmail || currentEmail === "github-actions[bot]@users.noreply.github.com"; + + if (shouldSetDefaults) { + execSync('git config --local user.email "team@pullfrog.com"', { + cwd: repoDir, + stdio: "pipe", + }); + execSync('git config --local user.name "pullfrog"', { + cwd: repoDir, + stdio: "pipe", + }); + log.debug("» git user configured (using defaults)"); + } else { + log.debug(`» git user already configured (${currentEmail}), skipping`); + } + // disable credential helper to prevent macOS keychain prompts when using x-access-token // only needed locally - GitHub Actions doesn't have this issue if (!process.env.GITHUB_ACTIONS) { @@ -51,7 +72,6 @@ export function setupGitConfig(): void { stdio: "pipe", }); } - log.debug("» git configuration set successfully (scoped to repo)"); } catch (error) { // If git config fails, log warning but don't fail the action // This can happen if we're not in a git repo or git isn't available