Skip to content

Commit 54b3bd4

Browse files
Changes to use updates in notifications from Localization CI
1 parent 3ee629a commit 54b3bd4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

open-pullrequest.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ param(
55
)
66

77
function Get-PullRequest() {
8-
$prInfo = (gh api -X GET repos/:owner/:repo/pulls -F head=":owner:$SourceBranch" -f state=open -f base=master | ConvertFrom-Json)
9-
return $prInfo.html_url
8+
return (gh api -X GET repos/:owner/:repo/pulls -F head=":owner:$SourceBranch" -f state=open -f base=master | ConvertFrom-Json)
109
}
1110

1211
$openedPR = Get-PullRequest
1312

14-
if ($openedPR.length -ne 0) {
13+
if ($openedPR.html_url.length -ne 0) {
1514
throw "A PR from $SourceBranch to master already exists."
1615
}
1716

@@ -20,6 +19,10 @@ $body = "This PR was auto-generated with [the localization pipeline build]($buil
2019

2120
gh pr create --head $SourceBranch --title 'Localization update' --body $body
2221

22+
# Getting a number to the opened PR
23+
$PR_NUMBER = (Get-PullRequest).number
24+
Write-Host "##vso[task.setvariable variable=PR_NUMBER]$PR_NUMBER"
25+
2326
# Getting a link to the opened PR
24-
$PR_LINK = Get-PullRequest
27+
$PR_LINK = (Get-PullRequest).html_url
2528
Write-Host "##vso[task.setvariable variable=PR_LINK]$PR_LINK"

0 commit comments

Comments
 (0)