File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,27 @@ Write-Information ((Get-ParsedBuildVersionXML -BuildInfo $buildInfo).GetEnumerat
2828
2929# merging the tag to develop branch on the official repository triggers the official build and release of the NuGet Packages
3030$tagName = Get-BuildVersionTag $buildInfo
31+
32+ # This will get the name of the remote matching $buildInfo['OfficialGitRemoteUrl'])
3133$officialRemoteName = Get-GitRemoteName $buildInfo official
34+
35+ # This will get the first remote that is NOT the official repo remote URL
36+ # This assumes there is only one such named remote. (Usually 'origin')
3237$forkRemoteName = Get-GitRemoteName $buildInfo fork
3338
39+ if ([string ]::IsNullOrWhiteSpace($officialRemoteName ))
40+ {
41+ throw " Official (official) remote is not available"
42+ }
43+
44+ if ([string ]::IsNullOrWhiteSpace($forkRemoteName ))
45+ {
46+ throw " Fork (origin) remote is not available"
47+ }
48+
49+ Write-Information " Official Remote Name: $officialRemoteName "
50+ Write-Information " Fork Remote Name: $forkRemoteName "
51+
3452$releaseBranch = " release/$tagName "
3553$officialReleaseBranch = " $officialRemoteName /$releaseBranch "
3654
Original file line number Diff line number Diff line change @@ -18,9 +18,26 @@ Param(
1818)
1919$buildInfo = Initialize-BuildEnvironment
2020
21+ # This will get the name of the remote matching $buildInfo['OfficialGitRemoteUrl'])
2122$officialRemoteName = Get-GitRemoteName $buildInfo official
23+
24+ # This will get the first remote that is NOT the official repo remote URL
25+ # This assumes there is only one such named remote. (Usually 'origin')
2226$forkRemoteName = Get-GitRemoteName $buildInfo fork
2327
28+ if ([string ]::IsNullOrWhiteSpace($officialRemoteName ))
29+ {
30+ throw " Official (official) remote is not available"
31+ }
32+
33+ if ([string ]::IsNullOrWhiteSpace($forkRemoteName ))
34+ {
35+ throw " Fork (origin) remote is not available"
36+ }
37+
38+ Write-Information " Official Remote Name: $officialRemoteName "
39+ Write-Information " Fork Remote Name: $forkRemoteName "
40+
2441# create new local branch for the release
2542$branchName = " release/$ ( Get-BuildVersionTag $buildInfo ) "
2643Write-Information " Creating release branch in local repo"
You can’t perform that action at this time.
0 commit comments