mirror of
https://github.com/markwylde/claude-code-gitea-action.git
synced 2026-02-20 10:32:49 +08:00
Attempt to make this work
This commit is contained in:
@@ -122,28 +122,25 @@ export async function setupBranch(
|
|||||||
|
|
||||||
// Verify the branch was created
|
// Verify the branch was created
|
||||||
const currentBranch = await $`git branch --show-current`;
|
const currentBranch = await $`git branch --show-current`;
|
||||||
console.log(
|
const branchName = currentBranch.toString().trim();
|
||||||
`Current branch after creation: ${currentBranch.stdout.trim()}`,
|
console.log(`Current branch after creation: ${branchName}`);
|
||||||
);
|
|
||||||
|
|
||||||
if (currentBranch.stdout.trim() === newBranch) {
|
if (branchName === newBranch) {
|
||||||
console.log(
|
console.log(
|
||||||
`✅ Successfully created and checked out branch: ${newBranch}`,
|
`✅ Successfully created and checked out branch: ${newBranch}`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Branch creation failed. Expected ${newBranch}, got ${currentBranch.stdout.trim()}`,
|
`Branch creation failed. Expected ${newBranch}, got ${branchName}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (gitError: any) {
|
} catch (gitError: any) {
|
||||||
console.error(`❌ Git operations failed:`, gitError);
|
console.error(`❌ Git operations failed:`, gitError);
|
||||||
console.error(`Error message: ${gitError.message}`);
|
console.error(`Error message: ${gitError.message || gitError}`);
|
||||||
console.error(`Error stdout: ${gitError.stdout}`);
|
|
||||||
console.error(`Error stderr: ${gitError.stderr}`);
|
|
||||||
|
|
||||||
// This is a critical failure - the branch MUST be created for Claude to work
|
// This is a critical failure - the branch MUST be created for Claude to work
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to create branch ${newBranch}: ${gitError.message}`,
|
`Failed to create branch ${newBranch}: ${gitError.message || gitError}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user