Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 854e3d5e4d |
@@ -24,6 +24,23 @@ export async function main(inputs: Inputs): Promise<MainResult> {
|
|||||||
try {
|
try {
|
||||||
log.info("Starting agent run...");
|
log.info("Starting agent run...");
|
||||||
|
|
||||||
|
// Debug logging for git repo detection
|
||||||
|
log.debug(`Current working directory: ${process.cwd()}`);
|
||||||
|
log.debug(`GITHUB_ACTIONS: ${process.env.GITHUB_ACTIONS}`);
|
||||||
|
log.debug(`GITHUB_WORKSPACE: ${process.env.GITHUB_WORKSPACE}`);
|
||||||
|
try {
|
||||||
|
const { execSync } = await import("node:child_process");
|
||||||
|
const gitDir = execSync("git rev-parse --git-dir", {
|
||||||
|
encoding: "utf-8",
|
||||||
|
stdio: "pipe",
|
||||||
|
}).trim();
|
||||||
|
log.debug(`Git directory found: ${gitDir}`);
|
||||||
|
} catch (error) {
|
||||||
|
log.debug(
|
||||||
|
`Git directory check failed: ${error instanceof Error ? error.message : String(error)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
setupGitConfig();
|
setupGitConfig();
|
||||||
|
|
||||||
const githubInstallationToken = await setupGitHubInstallationToken();
|
const githubInstallationToken = await setupGitHubInstallationToken();
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pullfrog/action",
|
"name": "@pullfrog/action",
|
||||||
"version": "0.0.78",
|
"version": "0.0.79",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"index.js",
|
"index.js",
|
||||||
|
|||||||
+33
-2
@@ -51,9 +51,40 @@ export function setupGitConfig(): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Debug logging for git repo detection
|
||||||
|
log.debug(`setupGitConfig: Current working directory: ${process.cwd()}`);
|
||||||
|
log.debug(`setupGitConfig: GITHUB_WORKSPACE: ${process.env.GITHUB_WORKSPACE}`);
|
||||||
|
|
||||||
|
// Check if we're in a git repository before trying to set config
|
||||||
|
log.debug(`setupGitConfig: Checking for git repository...`);
|
||||||
|
try {
|
||||||
|
const gitDir = execSync("git rev-parse --git-dir", { encoding: "utf-8", stdio: "pipe" }).trim();
|
||||||
|
log.debug(`setupGitConfig: Git directory found: ${gitDir}`);
|
||||||
|
} catch (error) {
|
||||||
|
log.warning(
|
||||||
|
`⚠️ Skipping git configuration setup (not in a git repository): ${error instanceof Error ? error.message : String(error)}`
|
||||||
|
);
|
||||||
|
try {
|
||||||
|
const dirContents = execSync("ls -la", { encoding: "utf-8", stdio: "pipe" }).trim();
|
||||||
|
log.debug(`setupGitConfig: Current directory contents:\n${dirContents}`);
|
||||||
|
} catch {
|
||||||
|
// Ignore if ls fails
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
log.info("🔧 Setting up git configuration...");
|
log.info("🔧 Setting up git configuration...");
|
||||||
execSync('git config user.email "action@pullfrog.ai"', { stdio: "inherit" });
|
try {
|
||||||
execSync('git config user.name "Pullfrog Action"', { stdio: "inherit" });
|
execSync('git config user.email "action@pullfrog.ai"', { stdio: "pipe" });
|
||||||
|
execSync('git config user.name "Pullfrog Action"', { stdio: "pipe" });
|
||||||
|
log.debug("setupGitConfig: ✓ Git configuration set successfully");
|
||||||
|
} 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
|
||||||
|
log.warning(
|
||||||
|
`Failed to set git config: ${error instanceof Error ? error.message : String(error)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user