Skip to content

Commit 70255ab

Browse files
msyycBigCat20196
andauthored
[pipeline] add variable for pipeline to paste issue link (Azure#20147)
* Update create_auto_release_pr * Update create_auto_release_pr.py * Update create_auto_release_pr.py * Update create_auto_release_pr.py * Update create_auto_release_pr.py * Update create_auto_release_pr.py * Update PythonSdkLiveTest.yml * Update create_auto_release_pr.py * Update PythonSdkLiveTest.yml Co-authored-by: BigCat20196 <[email protected]> Co-authored-by: Jiefeng Chen <[email protected]>
1 parent 9ce578d commit 70255ab

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scripts/auto_release/PythonSdkLiveTest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
export USR_NAME=$(USR_NAME)
7979
export USR_TOKEN=$(USR_TOKEN)
8080
export TEST_RESULT=$test_result
81+
export UPDATE_TOKEN=$(UPDATE_TOKEN)
8182
8283
python $script_path/create_auto_release_pr.py
8384
echo "\'[AutoRelease] $new_branch \' has been created!!!"

scripts/auto_release/create_auto_release_pr.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ def main():
99
pr_head = "{}:{}".format(os.getenv('USR_NAME'), os.getenv('NEW_BRANCH'))
1010
pr_base = os.getenv('TARGET_BRANCH')
1111
pr_body = "{} \n{}".format(os.getenv('ISSUE_LINK'), os.getenv('TEST_RESULT'))
12-
api.pulls.create(pr_title, pr_head, pr_base, pr_body)
12+
res_create = api.pulls.create(pr_title, pr_head, pr_base, pr_body)
13+
pr_number = res_create.number
14+
15+
# Add issue link on PR
16+
api = GhApi(owner='Azure', repo='azure-sdk-for-python', token=os.getenv('UPDATE_TOKEN'))
17+
api.issues.create_comment(issue_number=pr_number, body='issue link:{}'.format(os.getenv('ISSUE_LINK')))
1318

1419
if __name__ == '__main__':
1520
main()

0 commit comments

Comments
 (0)