Skip to content

Commit eca9b36

Browse files
authored
For PRs, skip stage 2 build if stage 1 fails (#46269)
1 parent 95a920b commit eca9b36

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

eng/pipelines/templates/jobs/vmr-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,13 @@ jobs:
142142

143143
${{ if ne(parameters.reuseBuildArtifactsFrom, '') }}:
144144
${{ if eq(parameters.buildPass, '') }}:
145-
# Always attempt to run the bootstrap leg (e.g. even when stage 1 tests fail) in order to get a complete accessment of the build status.
145+
# For PR builds, skip the stage 2 build if the stage 1 build fails.
146+
# Otherwise, run the stage 2 build even if the stage 1 build fails so that we can get a complete assessment of the build status.
146147
# The build shortcuts when stage 1 build fails and doesn't produce the SDK.
147-
condition: succeededOrFailed()
148+
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
149+
condition: succeeded()
150+
${{ else }}:
151+
condition: succeededOrFailed()
148152
${{ else }}:
149153
condition: succeeded()
150154
dependsOn: ${{ parameters.reuseBuildArtifactsFrom }}

0 commit comments

Comments
 (0)