@@ -180,7 +180,7 @@ jobs:
180180 $MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", ""
181181
182182 # replace preview with alpha if this is a PR build
183- if($env:Build_Reason -eq 'PullRequest ')
183+ if($env:System_PullRequest_PullRequestId -ne ' ')
184184 {
185185 $MyNuGetVersion = $MyNuGetVersion -replace "preview", "alpha"
186186 }
@@ -251,7 +251,7 @@ jobs:
251251
252252 # push NuGet class lib package to NuGet (happens on tag builds for any branch)
253253 - task : NuGetCommand@2
254- condition : and( succeeded(), ne (variables['Build.Reason '], 'PullRequest ') )
254+ condition : and( succeeded(), eq (variables['System.PullRequest.PullRequestId '], '') )
255255 displayName : Push NuGet packages to NuGet
256256 continueOnError : true
257257 inputs :
@@ -263,7 +263,7 @@ jobs:
263263
264264 # create or update GitHub release ON tags from release or master branches
265265 - task : GitHubReleasePublish@1
266- condition : and( succeeded(), ne (variables['Build.Reason '], 'PullRequest '), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
266+ condition : and( succeeded(), eq (variables['System.PullRequest.PullRequestId '], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
267267 displayName : Create/Update GitHub PREVIEW release
268268 inputs :
269269 githubEndpoint : ' nanoFramework'
0 commit comments