@@ -352,12 +352,16 @@ function Get-CurrentBuildKind
352
352
$currentBuildKind = [BuildKind ]::LocalBuild
353
353
354
354
# IsAutomatedBuild is the top level gate (e.g. if it is false, all the others must be false)
355
- $isAutomatedBuild = $env: CI `
356
- -or $env: APPVEYOR `
357
- -or $env: GITHUB_ACTIONS
355
+ $isAutomatedBuild = [ System.Convert ]::ToBoolean( $env: CI ) `
356
+ -or [ System.Convert ]::ToBoolean( $env: APPVEYOR ) `
357
+ -or [ System.Convert ]::ToBoolean( $env: GITHUB_ACTIONS )
358
358
359
359
if ( $isAutomatedBuild )
360
360
{
361
+ # PR and release builds have externally detected indicators that are tested
362
+ # below, so default to a CiBuild (e.g. not a PR, And not a RELEASE)
363
+ $currentBuildKind = [BuildKind ]::CiBuild
364
+
361
365
# IsPullRequestBuild indicates an automated buddy build and should not be trusted
362
366
$isPullRequestBuild = $env: GITHUB_BASE_REF -or $env: APPVEYOR_PULL_REQUEST_NUMBER
363
367
@@ -367,11 +371,11 @@ function Get-CurrentBuildKind
367
371
}
368
372
else
369
373
{
370
- if ($env: APPVEYOR )
374
+ if ([ System.Convert ]::ToBoolean( $env: APPVEYOR ) )
371
375
{
372
376
$isReleaseBuild = $env: APPVEYOR_REPO_TAG
373
377
}
374
- elseif ($env: GITHUB_ACTIONS )
378
+ elseif ([ System.Convert ]::ToBoolean( $env: GITHUB_ACTIONS ) )
375
379
{
376
380
$isReleaseBuild = $env: GITHUB_REF -like ' refs/tags/*'
377
381
}
@@ -450,6 +454,7 @@ function Initialize-BuildEnvironment
450
454
451
455
Write-Information " MSBUILD:`n $ ( $msbuild | Format-Table - AutoSize | Out-String ) "
452
456
Write-Information (dir env:Is* | Format-Table - Property Name, value | Out-String )
457
+ Write-Information (dir env:GITHUB* | Format-Table - Property Name, value | Out-String )
453
458
Write-Information " BuildKind: $global :CurrentBuildKind "
454
459
Write-Information " CiBuildName: $env: CiBuildName "
455
460
Write-Information ' PATH:'
0 commit comments