parent
e4f0d050a8
commit
2948972bfb
|
|
@ -31,7 +31,6 @@ param(
|
||||||
[switch]$NoPush,
|
[switch]$NoPush,
|
||||||
[string]$GitAuthorName = $null,
|
[string]$GitAuthorName = $null,
|
||||||
[string]$GitAuthorEmail = $null,
|
[string]$GitAuthorEmail = $null,
|
||||||
[string]$GithubToken = $null,
|
|
||||||
[switch]$Force,
|
[switch]$Force,
|
||||||
[string[]]$GitCommitArgs = @()
|
[string[]]$GitCommitArgs = @()
|
||||||
)
|
)
|
||||||
|
|
@ -44,7 +43,14 @@ Import-Module "$PSScriptRoot/common.psm1" -Scope Local -Force
|
||||||
$RepoRoot = Resolve-Path "$PSScriptRoot\.."
|
$RepoRoot = Resolve-Path "$PSScriptRoot\.."
|
||||||
$ModuleDirectory = Join-Path $RepoRoot "modules"
|
$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
|
Push-Location $ModuleDirectory
|
||||||
try {
|
try {
|
||||||
|
|
@ -73,13 +79,12 @@ try {
|
||||||
Write-Verbose "About to update dependencies.props for $($submodule.module)"
|
Write-Verbose "About to update dependencies.props for $($submodule.module)"
|
||||||
& .\run.ps1 upgrade deps --source $Source --id $LineupID --version $LineupVersion --deps-file $depsFile
|
& .\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.
|
# If there were any changes test and push.
|
||||||
& git diff --cached --quiet ./
|
& git diff --cached --quiet ./
|
||||||
$msgBody = "Update dependencies.props`n`n[auto-updated: dependencies]"
|
|
||||||
if ($LASTEXITCODE -ne 0) {
|
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
|
# Prepare this submodule for push
|
||||||
$sshUrl = "git@github.com:aspnet/$($submodule.module)"
|
$sshUrl = "git@github.com:aspnet/$($submodule.module)"
|
||||||
|
|
@ -100,10 +105,8 @@ try {
|
||||||
|
|
||||||
# Push the changes
|
# Push the changes
|
||||||
if (-not $NoPush -and ($Force -or ($PSCmdlet.ShouldContinue("Pushing updates to repos.", 'Push the changes to these repos?')))) {
|
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 {
|
try {
|
||||||
CreatePR "aspnet" $GithubUsername $baseBranch $upgradeBranch $msgBody $GithubToken
|
Invoke-Block { & git @gitConfigArgs push origin HEAD:$($submodule.branch)}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Warning "Error in pushing $($submodule.module): $_"
|
Write-Warning "Error in pushing $($submodule.module): $_"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue