mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
work (#8720)
This commit is contained in:
@@ -62,7 +62,25 @@ async function main() {
|
||||
// Check if hotfix branch already exists
|
||||
if (branchExists(hotfixBranch)) {
|
||||
console.log(`Hotfix branch ${hotfixBranch} already exists.`);
|
||||
return { existingBranch: hotfixBranch };
|
||||
|
||||
// Check if there's already a PR for this branch
|
||||
try {
|
||||
const prInfo = execSync(`gh pr list --head ${hotfixBranch} --json number,url --jq '.[0] // empty'`).toString().trim();
|
||||
if (prInfo && prInfo !== 'null' && prInfo !== '') {
|
||||
const pr = JSON.parse(prInfo);
|
||||
console.log(`Found existing PR #${pr.number}: ${pr.url}`);
|
||||
console.log(`Hotfix branch ${hotfixBranch} already has an open PR.`);
|
||||
return { existingBranch: hotfixBranch, existingPR: pr };
|
||||
} else {
|
||||
console.log(`Hotfix branch ${hotfixBranch} exists but has no open PR.`);
|
||||
console.log(`You may need to delete the branch and run this command again.`);
|
||||
return { existingBranch: hotfixBranch };
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`Error checking for existing PR: ${err.message}`);
|
||||
console.log(`Hotfix branch ${hotfixBranch} already exists.`);
|
||||
return { existingBranch: hotfixBranch };
|
||||
}
|
||||
}
|
||||
|
||||
// Create the hotfix branch from the release branch.
|
||||
|
||||
Reference in New Issue
Block a user