Skip to content

Commit 02c9c1a

Browse files
committed
add information about conditional in job dependencies
1 parent 09544a5 commit 02c9c1a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

content/actions/reference/workflow-syntax-for-github-actions.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,20 @@ The jobs in this example run sequentially:
270270
2. `job2`
271271
3. `job3`
272272

273+
Here is an example of using a [conditional statement](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions):
274+
275+
````yaml
276+
jobs:
277+
job1:
278+
job2:
279+
needs: job1
280+
job3:
281+
if: always()
282+
needs: [job1, job2]
283+
```
284+
285+
``job3` will run after `job1` and `job2` whether `job1` and `job2` are successful or not.
286+
273287
### **`jobs.<job_id>.runs-on`**
274288

275289
**Required** The type of machine to run the job on. The machine can be either a {% data variables.product.prodname_dotcom %}-hosted runner or a self-hosted runner.

0 commit comments

Comments
 (0)