You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[sdk-platform-java] update_generation_config.sh does not consider existing closed PRs when checking for branch existence #12372
Thanks for pointing out the exact logic accounting for this behavior. I feel we opened similar issues before.
My understanding this was the intended behavior for the design, but the error should be more specific -- workflow should fail if target branch exists but not associated with a PR. I expect the current error be: fatal: A branch named 'generate-libraries-<your_base_branch>' already exists.
For clarity, I suppose we can check explicitly and leave a bit more context in the log. I wonder if that would help?
if [ -z "${pr_num}" ]; then
# Check if the branch exists on the remote origin
if git ls-remote --exit-code --heads origin "${current_branch}" >/dev/null 2>&1; then
echo "Error: Branch '${current_branch}' exists on remote, but no open PR was found."
echo "Please delete the remote branch or reopen the PR."
exit 1
fi
# Safe to create the branch now
git checkout -b "${current_branch}"
# Push the current branch to remote so that we can compare the commits later.
git push -u origin "${current_branch}"
else
changed the title [-]`update_generation_config.sh` does not consider existing closed PRs when checking for branch existence[/-][+][sdk-platform-java] `update_generation_config.sh` does not consider existing closed PRs when checking for branch existence[/+]on Apr 1, 2026
Activity
zhumin8 commentedon Dec 8, 2025
Thanks for pointing out the exact logic accounting for this behavior. I feel we opened similar issues before.
My understanding this was the intended behavior for the design, but the error should be more specific -- workflow should fail if target branch exists but not associated with a PR. I expect the current error be:
fatal: A branch named 'generate-libraries-<your_base_branch>' already exists.For clarity, I suppose we can check explicitly and leave a bit more context in the log. I wonder if that would help?
For the time-being, the above workaround is fine.
[-]`update_generation_config.sh` does not consider existing closed PRs when checking for branch existence[/-][+][sdk-platform-java] `update_generation_config.sh` does not consider existing closed PRs when checking for branch existence[/+]