diff --git a/scripts/auto_release/PythonSdkLiveTest.yml b/scripts/auto_release/PythonSdkLiveTest.yml index 433ecaa81a4d..6ef26ff743e1 100644 --- a/scripts/auto_release/PythonSdkLiveTest.yml +++ b/scripts/auto_release/PythonSdkLiveTest.yml @@ -74,6 +74,7 @@ jobs: # create PR export NEW_BRANCH=`sed -n '1p' $output_path/output.txt` export TARGET_BRANCH=`sed -n '2p' $output_path/output.txt` + export NORMAL_GENERATION=`sed -n '3p' $output_path/output.txt` export ISSUE_LINK=$(ISSUE_LINK) export PIPELINE_LINK=$(PIPELINE_LINK) export USR_NAME=$(USR_NAME) diff --git a/scripts/auto_release/create_auto_release_pr.py b/scripts/auto_release/create_auto_release_pr.py index 9dafa7213691..28826e025649 100644 --- a/scripts/auto_release/create_auto_release_pr.py +++ b/scripts/auto_release/create_auto_release_pr.py @@ -15,6 +15,14 @@ def main(): # Add issue link on PR api = GhApi(owner='Azure', repo='azure-sdk-for-python', token=os.getenv('UPDATE_TOKEN')) api.issues.create_comment(issue_number=pr_number, body='issue link:{}'.format(os.getenv('ISSUE_LINK'))) + + # Check whether generate normally + if 'False' in os.getenv('NORMAL_GENERATION'): + api_request = GhApi(owner='Azure', repo='sdk-release-request', token=os.getenv('USR_TOKEN')) + link = os.getenv('ISSUE_LINK') + issue_number = link.split('/')[-1] + api_request.issues.add_labels(issue_number=int(issue_number), labels=['base-branch-attention']) + if __name__ == '__main__': main() diff --git a/scripts/auto_release/main.py b/scripts/auto_release/main.py index d8a923ceea16..fab4d7380048 100644 --- a/scripts/auto_release/main.py +++ b/scripts/auto_release/main.py @@ -14,6 +14,7 @@ BRANCH_BASE = '' OUT_PATH = '' NEW_BRANCH = '' +NORMAL_GENERATION = True _LOG = logging.getLogger() @@ -166,6 +167,8 @@ def edit_changelog(add_content): list_out = [list_in[0], '\n'] date = time.localtime(time.time()) list_out.append('## {} ({}-{:02d}-{:02d})\n\n'.format(VERSION_NEW, date.tm_year, date.tm_mon, date.tm_mday)) + if '0.0.0' == VERSION_NEW: + NORMAL_GENERATION = False for line in add_content: list_out.append(line + '\n') list_out.extend(list_in[1:]) @@ -459,4 +462,4 @@ def main(): my_print(e) else: with open(f'{OUT_PATH}/output.txt', 'w') as file_out: - file_out.writelines([f'{NEW_BRANCH}\n', "main" if TRACK == '2' else 'release/v3']) + file_out.writelines([f'{NEW_BRANCH}\n', "main\n" if TRACK == '2' else 'release/v3\n', str(NORMAL_GENERATION)])