Ryan Brandenburg 7 лет назад
Родитель
Сommit
76ff1dc5cd
3 измененных файлов с 15 добавлено и 7 удалено
  1. 1 1
      scripts/UpdateDependencies.ps1
  2. 5 3
      scripts/UpdateDependenciesCoreFx.ps1
  3. 9 3
      scripts/common.psm1

+ 1 - 1
scripts/UpdateDependencies.ps1

@@ -68,7 +68,7 @@ try {
         $body = CommitUpdatedVersions $updatedVars $dependencies $depsPath
         $body = CommitUpdatedVersions $updatedVars $dependencies $depsPath
 
 
         if ($body) {
         if ($body) {
-            CreatePR $GithubUpstreamBranch $destinationBranch $body $GithubToken
+            CreatePR "aspnet" $GithubUsername $GithubUpstreamBranch $destinationBranch $body $GithubToken
         }
         }
     }
     }
 }
 }

+ 5 - 3
scripts/UpdateDependenciesCoreFx.ps1

@@ -22,6 +22,9 @@ $coreFxRepo = "dotnet/corefx"
 $coreSetupVersions = "$githubRaw/$versionsRepo/$versionsBranch/build-info/$coreSetupRepo/master/Latest_Packages.txt"
 $coreSetupVersions = "$githubRaw/$versionsRepo/$versionsBranch/build-info/$coreSetupRepo/master/Latest_Packages.txt"
 
 
 $tempDir = "$PSScriptRoot/../obj"
 $tempDir = "$PSScriptRoot/../obj"
+
+mkdir -Path $tempDir -ErrorAction Ignore
+
 $localCoreSetupVersions = "$tempDir/coresetup.packages"
 $localCoreSetupVersions = "$tempDir/coresetup.packages"
 Write-Host "Downloading $coreSetupVersions to $localCoreSetupVersions"
 Write-Host "Downloading $coreSetupVersions to $localCoreSetupVersions"
 Invoke-WebRequest -OutFile $localCoreSetupVersions -Uri $coreSetupVersions
 Invoke-WebRequest -OutFile $localCoreSetupVersions -Uri $coreSetupVersions
@@ -103,19 +106,18 @@ $depsPath = Resolve-Path "$PSScriptRoot/../build/dependencies.props"
 Write-Host "Loading deps from $depsPath"
 Write-Host "Loading deps from $depsPath"
 [xml] $dependencies = LoadXml $depsPath
 [xml] $dependencies = LoadXml $depsPath
 
 
-$remote = "origin"
 $baseBranch = "dev"
 $baseBranch = "dev"
 
 
 $currentBranch = Invoke-Block { & git rev-parse --abbrev-ref HEAD }
 $currentBranch = Invoke-Block { & git rev-parse --abbrev-ref HEAD }
 $destinationBranch = "rybrande/UpgradeDepsTest"
 $destinationBranch = "rybrande/UpgradeDepsTest"
 
 
-Invoke-Block { & git checkout -tb $destinationBranch "$remote/$baseBranch" }
+Invoke-Block { & git checkout -tb $destinationBranch "origin/$baseBranch" }
 try {
 try {
     $updatedVars = UpdateVersions $variables $dependencies $depsPath
     $updatedVars = UpdateVersions $variables $dependencies $depsPath
     $body = CommitUpdatedVersions $updatedVars $dependencies $depsPath
     $body = CommitUpdatedVersions $updatedVars $dependencies $depsPath
 
 
     if ($body) {
     if ($body) {
-        CreatePR $baseBranch $destinationBranch $body $GithubToken
+        CreatePR "aspnet" $GithubUsername $baseBranch $destinationBranch $body $GithubToken
     }
     }
 }
 }
 finally {
 finally {

+ 9 - 3
scripts/common.psm1

@@ -136,11 +136,17 @@ function Ensure-Hub() {
     return $hubLocation
     return $hubLocation
 }
 }
 
 
-function CreatePR([string]$baseBranch, [string]$destinationBranch, [string]$body, [string]$gitHubToken) {
+function CreatePR(
+    [string]$baseFork,
+    [string]$headFork,
+    [string]$baseBranch,
+    [string]$destinationBranch,
+    [string]$body,
+    [string]$gitHubToken) {
     $hubLocation = Ensure-Hub
     $hubLocation = Ensure-Hub
 
 
-    Invoke-Block { git push -f https://[email protected]/aspnet/Universe.git $destinationBranch }
-    & $hubLocation pull-request -f -b $baseBranch -h $destinationBranch -m $body
+    Invoke-Block { git push -f https://[email protected]/$headFork/Universe.git $destinationBranch }
+    & $hubLocation pull-request -f -b "${baseFork}:$baseBranch" -h "${headFork}:$destinationBranch" -m $body
 }
 }
 
 
 function Set-GithubInfo(
 function Set-GithubInfo(