Skip to content

Commit

Permalink
[Bug] Do not process if the branch already exists on the remote
Browse files Browse the repository at this point in the history
  * For preventing from creating duplicated branch accidentally

Signed-off-by: Junya Sasaki <[email protected]>
  • Loading branch information
sasakisasaki committed Aug 27, 2024
1 parent 36c6689 commit 1932f1c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions create_version_update_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ def create_version_update_pr(args: argparse.Namespace) -> None:
# Set branch name
branch_name: str = f"{args.new_branch_prefix}{repo_name}/{latest_tag}"

# Check if the remote branch already exists
if branch_name in repo.remotes.origin.refs:
logger.info(f"Branch '{branch_name}' already exists.")
continue

# First, create a branch
newly_created: bool = create_one_branch(repo, branch_name)

Expand Down

0 comments on commit 1932f1c

Please sign in to comment.