File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 5
5
)
6
6
7
7
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 )
10
9
}
11
10
12
11
$openedPR = Get-PullRequest
13
12
14
- if ($openedPR.length -ne 0 ) {
13
+ if ($openedPR.html_url. length -ne 0 ) {
15
14
throw " A PR from $SourceBranch to master already exists."
16
15
}
17
16
@@ -20,6 +19,10 @@ $body = "This PR was auto-generated with [the localization pipeline build]($buil
20
19
21
20
gh pr create -- head $SourceBranch -- title ' Localization update' -- body $body
22
21
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
+
23
26
# Getting a link to the opened PR
24
- $PR_LINK = Get-PullRequest
27
+ $PR_LINK = ( Get-PullRequest ).html_url
25
28
Write-Host " ##vso[task.setvariable variable=PR_LINK]$PR_LINK "
You can’t perform that action at this time.
0 commit comments