Skip to content
Open
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
9 changes: 8 additions & 1 deletion tools/devops/automation/scripts/GitHub.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class GitHubComments {
return $true
} else {
# we might have gotten here because of the trigger type. This means that we are in a PR BUT
# we did not get the PR ids, but those can be found in the diff evirtoment vars
# we did not get the PR ids, but those can be found in the diff environment vars
if ($Env:BUILD_REASON -eq "PullRequest") {
# set the PR ids to the PR we have in the VSTS env vars
$this.PRIds = @($Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)
Expand Down Expand Up @@ -1118,6 +1118,13 @@ function Get-GitHubPRsForHash {
Write-Host "Getting related PR ids for commit $Hash"

$prs = [System.Collections.ArrayList]@()

if ($Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) {
Write-Host "Found PR in environment: $Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
$prs.Add($Env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) > $null
return $prs
}

if ($Env:IS_PR -eq "false") {
Write-Host "This isn't a PR, IS_PR=false"
return $prs
Expand Down
Loading