File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,10 +60,13 @@ def delete_preview_command(
6060 root_git .checkout ("master" )
6161 logging .info ("Config repo branch master checkout successful" )
6262
63- config_branch = f"gitopscli-delete-preview-{ str (uuid .uuid4 ())[:8 ]} " if create_pr else "master"
63+ if create_pr :
64+ config_branch = f"gitopscli-delete-preview-{ str (uuid .uuid4 ())[:8 ]} "
65+ root_git .new_branch (config_branch )
66+ logging .info ("Created branch %s in config repo" , config_branch )
67+ else :
68+ config_branch = "master"
6469
65- root_git .new_branch (config_branch )
66- logging .info ("Created branch %s in config repo" , config_branch )
6770 shortened_branch_hash = hashlib .sha256 (branch .encode ("utf-8" )).hexdigest ()[:8 ]
6871 logging .info ("Hashed branch %s to hash: %s" , branch , shortened_branch_hash )
6972 preview_folder_name = gitops_config .application_name + "-" + shortened_branch_hash + "-preview"
You can’t perform that action at this time.
0 commit comments