diff --git a/Internal/Deploy.ps1 b/Internal/Deploy.ps1 index 84ca0b8f83..1f8c978a4c 100644 --- a/Internal/Deploy.ps1 +++ b/Internal/Deploy.ps1 @@ -26,6 +26,7 @@ function PushChanges # Direct commit to base branch invoke-git commit --allow-empty -m $CommitMessage invoke-git push origin $BaseBranch + return "" } else { # Create PR to base branch if (-not (git ls-remote --heads origin $BaseBranch)) { @@ -38,7 +39,9 @@ function PushChanges invoke-git checkout -b $branchName origin/$BaseBranch invoke-git commit --allow-empty -m $CommitMessage invoke-git push origin $branchName - invoke-gh pr create --base $BaseBranch --title $CommitMessage --body $CommitMessage + $prUrl = invoke-gh -returnValue pr create --base $BaseBranch --title $CommitMessage --body $CommitMessage + + return $prUrl } } @@ -242,8 +245,12 @@ try { } Set-Content -Path (Join-Path "./.github" "RELEASENOTES.copy.md") -Value $releaseNotes -Encoding utf8 } - PushChanges -BaseBranch $branch -CommitMessage "Deploying AL-Go from $algoBranch ($srcSHA) to $branch" -DirectCommit $directCommit - + $prUrl = PushChanges -BaseBranch $branch -CommitMessage "Deploying AL-Go from $algoBranch ($srcSHA) to $branch" -DirectCommit $directCommit + if ($prUrl) { + Write-Host "::notice::Deployed to $repo branch $branch. PR URL: $prUrl" + } else { + Write-Host "::notice::Deployed to $repo branch $branch" + } } } finally { diff --git a/e2eTests/e2eTestHelper.psm1 b/e2eTests/e2eTestHelper.psm1 index e3bdaefe7a..d14b219bc1 100644 --- a/e2eTests/e2eTestHelper.psm1 +++ b/e2eTests/e2eTestHelper.psm1 @@ -272,7 +272,8 @@ function WaitWorkflow { [string] $repository, [string] $runid, [switch] $noDelay, - [switch] $noError + [switch] $noError, + [switch] $noRerun ) $delay = !$noDelay.IsPresent @@ -301,6 +302,11 @@ function WaitWorkflow { Write-Host "Workflow conclusion: $($run.conclusion)" if ($run.conclusion -ne "Success" -and $run.conclusion -ne "cancelled") { + if (-not $noRerun.IsPresent) { + Write-Host "::warning::Rerunning workflow: $($run.name) run $($run.id), conclusion $($run.conclusion), url = $($run.html_url)" + invoke-gh api --method POST /repos/$repository/actions/runs/$runid/rerun | Out-Null + WaitWorkflow -repository $repository -runid $runid -noDelay:$noDelay -noError:$noError -noRerun + } if (-not $noError.IsPresent) { throw "Workflow $($run.name), conclusion $($run.conclusion), url = $($run.html_url)" } } }