Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Internal/Deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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
}
}

Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 7 additions & 1 deletion e2eTests/e2eTestHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ function WaitWorkflow {
[string] $repository,
[string] $runid,
[switch] $noDelay,
[switch] $noError
[switch] $noError,
[switch] $noRerun
)

$delay = !$noDelay.IsPresent
Expand Down Expand Up @@ -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)" }
}
}
Expand Down
Loading