Revert "Update repos send PRs"

This reverts commit 1593966f3b.
This commit is contained in:
Ryan Brandenburg 2018-10-09 10:47:23 -07:00
parent e4f0d050a8
commit 2948972bfb
1 changed files with 11 additions and 8 deletions

View File

@ -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): $_"