File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ param (
2+ [Parameter (Mandatory )]
3+ [string ]
4+ $SourceBranch
5+ )
6+
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
10+ }
11+
12+ $openedPR = Get-PullRequest
13+
14+ if ($openedPR.length -ne 0 ) {
15+ throw " A PR from $SourceBranch to master already exists."
16+ }
17+
18+ $buildUrl = " $env: SYSTEM_TEAMFOUNDATIONCOLLECTIONURI$env: SYSTEM_TEAMPROJECT /_build/results?buildId=$env: BUILD_BUILDID &_a=summary"
19+ $body = " This PR was auto-generated with [the localization pipeline build]($buildUrl )."
20+
21+ gh pr create -- head $SourceBranch -- title ' Localization update' -- body $body
22+
23+ # Getting a link to the opened PR
24+ $env: PR_LINK = Get-PullRequest
You can’t perform that action at this time.
0 commit comments