From 2948972bfb2751862e1255b3843093723b07b0cd Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Tue, 9 Oct 2018 10:47:23 -0700 Subject: [PATCH] Revert "Update repos send PRs" This reverts commit 1593966f3bd183491162b5a505110ecc7e4bc9b5. --- scripts/UpdateRepos.ps1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/UpdateRepos.ps1 b/scripts/UpdateRepos.ps1 index 8a59675c8e..24b921b867 100755 --- a/scripts/UpdateRepos.ps1 +++ b/scripts/UpdateRepos.ps1 @@ -31,7 +31,6 @@ param( [switch]$NoPush, [string]$GitAuthorName = $null, [string]$GitAuthorEmail = $null, - [string]$GithubToken = $null, [switch]$Force, [string[]]$GitCommitArgs = @() ) @@ -44,7 +43,14 @@ Import-Module "$PSScriptRoot/common.psm1" -Scope Local -Force $RepoRoot = Resolve-Path "$PSScriptRoot\.." $ModuleDirectory = Join-Path $RepoRoot "modules" -Set-GitHubInfo $GithubToken $GitAuthorName $GitAuthorEmail +$gitConfigArgs = @() +if ($GitAuthorName) { + $gitConfigArgs += '-c', "user.name=$GitAuthorName" +} + +if ($GitAuthorEmail) { + $gitConfigArgs += '-c', "user.email=$GitAuthorEmail" +} Push-Location $ModuleDirectory try { @@ -73,13 +79,12 @@ try { Write-Verbose "About to update dependencies.props for $($submodule.module)" & .\run.ps1 upgrade deps --source $Source --id $LineupID --version $LineupVersion --deps-file $depsFile - Invoke-Block { & git add $depsFile $koreBuildLock } + Invoke-Block { & git @gitConfigArgs add $depsFile $koreBuildLock } # If there were any changes test and push. & git diff --cached --quiet ./ - $msgBody = "Update dependencies.props`n`n[auto-updated: dependencies]" if ($LASTEXITCODE -ne 0) { - Invoke-Block { & git commit --quiet -m $msgBody @GitCommitArgs } + Invoke-Block { & git @gitConfigArgs commit --quiet -m "Update dependencies.props`n`n[auto-updated: dependencies]" @GitCommitArgs } # Prepare this submodule for push $sshUrl = "git@github.com:aspnet/$($submodule.module)" @@ -100,10 +105,8 @@ try { # Push the changes if (-not $NoPush -and ($Force -or ($PSCmdlet.ShouldContinue("Pushing updates to repos.", 'Push the changes to these repos?')))) { - $baseBranch = $submodule.branch - $upgradeBranch = "$baseBranch/upgrade-deps" try { - CreatePR "aspnet" $GithubUsername $baseBranch $upgradeBranch $msgBody $GithubToken + Invoke-Block { & git @gitConfigArgs push origin HEAD:$($submodule.branch)} } catch { Write-Warning "Error in pushing $($submodule.module): $_"