You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/pipelines/process/conditions.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ stages:
111
111
112
112
### Stage example 2
113
113
114
-
In the following pipeline, `stage2` depends on `stage1` by default. Job `B` in `stage 2` has a `condition` set. If you queue a build on the `main` branch and cancel it while `stage1` is running, `stage2` doesn't run, even though it contains a job whose condition evaluates to `true`.
114
+
In the following pipeline, `stage2` depends on `stage1` by default. Job `B` in `stage2` has a `condition` set. If you queue a build on the `main` branch and cancel it while `stage1` is running, `stage2` doesn't run, even though it contains a job whose condition evaluates to `true`.
115
115
116
116
The reason is because `stage2` has the default `condition: succeeded()`, which evaluates to `false` when `stage1` is canceled. Therefore, `stage2` is skipped, and none of its jobs run.
117
117
@@ -209,7 +209,7 @@ The following table shows example `condition` settings to produce various outcom
209
209
> [!NOTE]
210
210
> `Release.Artifacts.{artifact-alias}.SourceBranch` is equivalent to `Build.SourceBranch`.
211
211
212
-
| Desired outcome | Condition setting |
212
+
| Desired outcome | Example condition setting |
213
213
| --------------- | ----------------- |
214
214
| Run if the source branch is main, even if the parent or preceding stage, job, or step failed or was canceled. | `eq(variables['Build.SourceBranch'], 'refs/heads/main')` |
215
215
| Run if the source branch is main and the parent or preceding stage, job, or step succeeded. | `and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))` |
@@ -237,7 +237,7 @@ The following table shows example `condition` settings to produce various outcom
237
237
238
238
### Parameters in conditions
239
239
240
-
Parameter expansion happens before conditions are considered. Therefore, when you declare a parameter in the same pipeline as a condition, you can embed the parameter inside the condition. The script in the following YAML file runs because `parameters.doThing` is true.
240
+
Parameter expansion happens before conditions are considered. Therefore, when you declare a parameter in the same pipeline as a condition, you can embed the parameter inside the condition. The script in the following YAML runs because `parameters.doThing` is true.
241
241
242
242
```yaml
243
243
parameters:
@@ -345,7 +345,7 @@ steps:
345
345
346
346
### How can I trigger a job if a previous job succeeded with issues?
347
347
348
-
You can use the result of the previous job in a condition. For example, in the following YAML file, the condition `eq(dependencies.A.result,'SucceededWithIssues')` allows job `B` to run because job `A` succeeded with issues.
348
+
You can use the result of the previous job in a condition. For example, in the following YAML, the condition `eq(dependencies.A.result,'SucceededWithIssues')` allows job `B` to run because job `A` succeeded with issues.
0 commit comments