Skip to content

Commit f424ae4

Browse files
BigCat20196msyyc
andauthored
[Auto release debug] Add prompt statement (Azure#23102)
* fix auto-ask-check bug * update comment * update comment * fix bug * Update main.py * Update main.py * Update main.py Co-authored-by: Yuchao Yan <[email protected]>
1 parent 0270426 commit f424ae4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/auto_release/main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,12 @@ def check_file(self):
410410
def sdk_code_path(self) -> str:
411411
return str(Path(f'sdk/{self.sdk_folder}/azure-mgmt-{self.package_name}'))
412412

413+
@property
414+
def is_single_path(self) -> bool:
415+
path = str(Path(f'sdk/{self.sdk_folder}'))
416+
num = sum([os.path.isdir(str(Path(f'{path}/{listx}'))) for listx in os.listdir(path)])
417+
return num == 1
418+
413419
@return_origin_path
414420
def install_package_locally(self):
415421
os.chdir(self.sdk_code_path())
@@ -454,6 +460,8 @@ def create_pr_proc(self):
454460
pr_head = "{}:{}".format(os.getenv('USR_NAME'), self.new_branch)
455461
pr_base = 'main'
456462
pr_body = "{} \n{} \n{}".format(self.issue_link, self.test_result, self.pipeline_link)
463+
if not self.is_single_path:
464+
pr_body += f'\nBuildTargetingString\n azure-mgmt-{self.package_name}\nSkip.CreateApiReview\ntrue'
457465
res_create = api.pulls.create(pr_title, pr_head, pr_base, pr_body)
458466

459467
# Add issue link on PR

0 commit comments

Comments
 (0)