chore: Add git status output to log when push fails (#531)

This commit is contained in:
Brace Sproul 2025-07-25 09:17:52 -07:00 • committed by GitHub
parent 5cd5ce53ad
commit e4fbd828d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -128,6 +128,7 @@ export async function checkoutBranchAndCommit(
);
if (pushRes instanceof Error) {
const gitStatus = await sandbox.git.status(absoluteRepoDir);
const errorFields = {
...(pushRes instanceof Error
? {
@ -138,7 +139,10 @@ export async function checkoutBranchAndCommit(
}
: pushRes),
};
logger.error("Failed to push changes", errorFields);
logger.error("Failed to push changes", {
...errorFields,
gitStatus: JSON.stringify(gitStatus, null, 2),
});
throw new Error("Failed to push changes");
} else {
logger.info("Successfully pushed changes");